Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrometheusServiceMeter ¶
PrometheusServiceMeter provides 3 meters to measure: 1. Count number of requests 2. Measure response time 3. Count number of error requests
func NewPrometheusServiceMeter ¶
func NewPrometheusServiceMeter(ctx context.Context, conf *PrometheusServiceMeterConfig) *PrometheusServiceMeter
func (*PrometheusServiceMeter) Close ¶
func (m *PrometheusServiceMeter) Close() error
func (*PrometheusServiceMeter) UnaryServerInterceptor ¶
func (m *PrometheusServiceMeter) UnaryServerInterceptor() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs.
type PrometheusServiceMeterConfig ¶
type PrometheusServiceMeterConfig struct { Addr string `long:"addr" env:"ADDR" description:"the prometheus exporter address" default:":2222"` Path string `long:"path" env:"PATH" description:"the prometheus exporter path" default:"/metrics"` Name string `long:"name" env:"NAME" description:"the unique instrumentation name" required:"true"` HistogramBoundaries []float64 `` /* 145-byte string literal not displayed */ }
Click to show internal directories.
Click to hide internal directories.