Documentation
¶
Index ¶
Constants ¶
const ( Method string = "method" Status string = "status" Path string = "path" )
List of metric labels
const ( Unary grpcType = "unary" ClientStream grpcType = "client_stream" ServerStream grpcType = "server_stream" BidiStream grpcType = "bidi_stream" )
Variables ¶
This section is empty.
Functions ¶
func NewPrometheusMetrics ¶
func NewPrometheusMetrics(config *MetricsConfig) (*prometheusMetrics, error)
func NewTmpPrometheusMetrics ¶
func NewTmpPrometheusMetrics() *prometheusMetrics
Types ¶
type Metric ¶
type Metric struct { Name string Type MetricType Subsystem Subsystem Description string Labels []string Buckets []float64 }
var Grpc_server_handled_total *Metric = &Metric{ Name: "server_handled_total", Description: "Total number of RPCs completed on the server, regardless of success or failure.", Subsystem: GRPC, Type: Counter, Labels: []string{"grpc_type", "grpc_service", "grpc_method", Status}, }
grpc_server_handled_total is a counter metric that measures the total number of requests.
var Grpc_server_handling_seconds *Metric = &Metric{ Name: "server_handling_seconds", Description: "Histogram metric that measures the duration of the request in seconds.", Subsystem: GRPC, Type: Histogram, Labels: []string{"grpc_type", "grpc_service", "grpc_method"}, Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}, }
grpc_server_handling_seconds is a histogram metric that measures the duration of the request in seconds.
var Grpc_server_msg_received_total *Metric = &Metric{ Name: "server_msg_received_total", Description: "Total number of RPC stream messages received on the server.", Subsystem: GRPC, Type: Counter, Labels: []string{"grpc_type", "grpc_service", "grpc_method"}, }
grpc_server_msg_received_total is a counter metric that measures the total number of RPC stream messages received on the server.
var Grpc_server_msg_sent_total *Metric = &Metric{ Name: "server_msg_sent_total", Description: "Total number of gRPC stream messages sent by the server.", Subsystem: GRPC, Type: Counter, Labels: []string{"grpc_type", "grpc_service", "grpc_method"}, }
grpc_server_msg_sent_total is a counter metric that measures the total number of gRPC stream messages sent by the server.
var Grpc_server_started_total *Metric = &Metric{ Name: "server_started_total", Description: "Total number of RPCs started on the server.", Subsystem: GRPC, Type: Counter, Labels: []string{"grpc_type", "grpc_service", "grpc_method"}, }
grpc_server_started_total is a gauge metric that measures the number of requests currently in progress.
var Http_request_duration_seconds *Metric = &Metric{ Name: "request_duration_seconds", Subsystem: HTTP, Description: "Histogram metric that measures the duration of the request in seconds.", Type: Histogram, Labels: []string{Path}, Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}, }
http_request_duration_seconds is a histogram metric that measures the duration of the request in seconds.
var Http_request_inflight *Metric = &Metric{ Name: "request_inflight", Description: "Gauge metric that measures the number of requests currently in progress.", Subsystem: HTTP, Type: Gauge, Labels: []string{Path}, }
http_request_inflight is a gauge metric that measures the number of requests currently in progress.
var Http_request_size_bytes *Metric = &Metric{ Name: "request_size_bytes", Description: "Histogram metric that measures the size of the request in bytes.", Subsystem: HTTP, Type: Histogram, Labels: []string{Path}, Buckets: sizeBuckets, }
http_request_size_bytes is a histogram metric that measures the size of the request in bytes.
var Http_request_total *Metric = &Metric{ Name: "request_total", Description: "Counter metric that measures the total number of requests.", Subsystem: HTTP, Type: Counter, Labels: []string{Path, Status}, }
http_request_total is a counter metric that measures the total number of requests.
var Http_response_size_bytes *Metric = &Metric{ Name: "response_size_bytes", Description: "Histogram metric that measures the size of the response in bytes.", Subsystem: HTTP, Type: Histogram, Labels: []string{Path}, Buckets: sizeBuckets, }
http_response_size_bytes is a histogram metric that measures the size of the response in bytes.
type MetricType ¶
type MetricType string
const ( Counter MetricType = "COUNTER" Gauge MetricType = "GAUGE" Histogram MetricType = "HISTOGRAM" )
type Metrics ¶
type Metrics interface { RunHTTPMetricsServer(ctx context.Context, address string) Counter(metric *Metric, value float64, labelValues ...string) error AddGauge(metric *Metric, value float64, labelValues ...string) error SetGauge(metric *Metric, value float64, labelValues ...string) error Histogram(metric *Metric, value float64, labelValues ...string) error IsMetricExist(name string) bool }
func MetricFactory ¶
type MetricsConfig ¶
TracerConfig is the configuration for the tracer
type Option ¶
type Option func(f *MetricsConfig)