metrics

package
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodLabel = "method"
)

Variables

View Source
var (
	RequestsInFlight = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "claudie_grpc_request_in_flight",
			Help: "Number of grpc requests currently handled",
		},
	)

	RequestCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "claudie_grpc_request_count",
			Help: "Total number of gRPC API calls.",
		},
		[]string{MethodLabel},
	)

	Latency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name: "claudie_grpc_call_latency_seconds",
			Help: "Latency of gRPC API calls in seconds.",
			Buckets: []float64{
				.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10,
				20, 30, 60, 300, 600,
				1200, 1800, 2700, 3600,
			},
		},
		[]string{MethodLabel},
	)

	ErrorCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "grpc_error_count",
			Help: "Total number of gRPC API call errors.",
		},
		[]string{MethodLabel},
	)
)

Functions

func MetricsMiddleware

func MetricsMiddleware(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

func MustRegisterCounters

func MustRegisterCounters()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL