grpcmetrics

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

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

Constants

View Source
const (
	Unknown  = "unknown"
	Canceled = "canceled"
)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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