grpctelemetry

package
v1.42.6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

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