Documentation
¶
Index ¶
- Variables
- func IncrementRequestCount(requestType, node string)
- func IncrementRequestStatusCount(requestType, node string, statusCode int)
- func PrepareMetricsServer(addr string, path string) *http.Server
- func UpdateNodeCount(nodeType string, count float64)
- func UpdateNodeHealth(nodeType, node string, healthy bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NodeCounts is a gauge that tracks the number of available nodes for each type NodeCounts = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "proxy_node_count", Help: "Number of healthy nodes for each type", }, []string{"type"}, ) // RequestCount is a counter that tracks the number of requests per node for each type. // It has the following labels: // - type: The type of request (rest/rpc/grpc) // - node: The node handling the request RequestCount = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "proxy_request_count", Help: "Number of requests per node for each type", }, []string{"type", "node"}, ) // RequestStatusCount is a counter that tracks the number of requests by status code. // It has the following labels: // - type: The type of request (rest/rpc/grpc) // - node: The node handling the request // - status_code: The HTTP status code of the response RequestStatusCount = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "proxy_request_status_count", Help: "Number of requests by status code", }, []string{"type", "node", "status_code"}, ) // NodeHealth is a gauge that tracks the health status of each node // It has the following labels: // - type: The type of node (rest/rpc/grpc) // - node: The node identifier (usually the host) // Value is 1 if healthy, 0 if unhealthy NodeHealth = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "proxy_node_health", Help: "Health status of each node (1 = healthy, 0 = unhealthy)", }, []string{"type", "node"}, ) )
Functions ¶
func IncrementRequestCount ¶
func IncrementRequestCount(requestType, node string)
IncrementRequestCount increments the request count for a specific type and node
func IncrementRequestStatusCount ¶
IncrementRequestStatusCount increments the request count for a specific type, node, and status code
func PrepareMetricsServer ¶
PrepareMetricsServer prepares a new HTTP server for Prometheus metrics
func UpdateNodeCount ¶
UpdateNodeCount updates the node count for a specific type
func UpdateNodeHealth ¶
UpdateNodeHealth updates the health status for a specific node
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.