Documentation ¶
Overview ¶
Package grpcmetrics provides interceptors for collecting metrics about grpc servers and clients.
Metrics are prefixed with:
grpc.{server,client}.<service>.<method>
For example:
grpc.server.domain-streamer.put-domain grpc.client.domain-streamer.stream-updates
For each endpoint, clients and servers will report:
requests - counter of requests request-duration.ms - histogram of request durations in milliseconds errors - counter of requests which result in errors response-codes.<code> - counter of grpc response codes
In addition to these metrics, streams will also report:
stream.clients - gauge of connected clients stream.sends - counter of sent messages stream.sends.errors - counter of message send errors stream.send-duration.ms - histogram of send durations in milliseconds stream.recvs - counter of received messages stream.recvs.errors - counter of message recv errors stream.recv-duration.ms - histogram of recv durations in milliseconds
Index ¶
- func InstrumentedDialer(id, metricsNamespace string, r metricsregistry.Registry) func(string, time.Duration) (net.Conn, error)
- func NewStreamClientInterceptor(r metricsregistry.Registry) grpc.StreamClientInterceptor
- func NewStreamServerInterceptor(p metrics.Provider) grpc.StreamServerInterceptor
- func NewUnaryClientInterceptor(r metricsregistry.Registry) grpc.UnaryClientInterceptor
- func NewUnaryServerInterceptor(p metrics.Provider) grpc.UnaryServerInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstrumentedDialer ¶
func InstrumentedDialer(id, metricsNamespace string, r metricsregistry.Registry) func(string, time.Duration) (net.Conn, error)
InstrumentedDialer returns an instrumented dialer for use with grpc.WithDialer, reporting dialing metrics using the given id, metricsNamespace, and registry.
func NewStreamClientInterceptor ¶
func NewStreamClientInterceptor(r metricsregistry.Registry) grpc.StreamClientInterceptor
NewStreamClientInterceptor returns an interceptor for stream client calls which will report metrics using the given registry.
func NewStreamServerInterceptor ¶
func NewStreamServerInterceptor(p metrics.Provider) grpc.StreamServerInterceptor
NewStreamServerInterceptor returns an interceptor for stream server calls which will report metrics to the given provider.
func NewUnaryClientInterceptor ¶
func NewUnaryClientInterceptor(r metricsregistry.Registry) grpc.UnaryClientInterceptor
NewUnaryClientInterceptor returns an interceptor for unary client calls which will report metrics using the given registry.
func NewUnaryServerInterceptor ¶
func NewUnaryServerInterceptor(p metrics.Provider) grpc.UnaryServerInterceptor
NewUnaryServerInterceptor returns an interceptor for unary server calls which will report metrics to the given provider.
Types ¶
This section is empty.