Documentation
¶
Overview ¶
Package grpctelemetry provides generic, Prometheus-native gRPC server metrics for any service in this repo. Named grpctelemetry, not grpc, so callers don't need to alias it against google.golang.org/grpc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerMetrics ¶
type ServerMetrics struct {
*grpcprom.ServerMetrics
}
ServerMetrics is go-grpc-middleware/providers/prometheus's ServerMetrics, already registered. Embedding promotes UnaryServerInterceptor, StreamServerInterceptor, and InitializeMetrics directly.
func NewServerMetrics ¶
func NewServerMetrics(reg prometheus.Registerer) (*ServerMetrics, error)
NewServerMetrics builds and registers standard gRPC server metrics into reg. Wire UnaryServerInterceptor() first in the interceptor chain so its recorded duration covers the full request lifecycle, and call InitializeMetrics(server) once every service is registered, so each method appears in the registry before its first call.