Documentation ¶
Index ¶
- Constants
- func NewClientHandler(options ...Option) (stats.Handler, error)
- func NewServerHandler(options ...Option) (stats.Handler, error)
- type Handler
- func (h *Handler) HandleConn(_ context.Context, _ stats.ConnStats)
- func (h *Handler) HandleRPC(ctx context.Context, rs stats.RPCStats)
- func (h *Handler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
- func (h *Handler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
- type Option
Constants ¶
View Source
const (
// DefaultInstrumentationName is the default used when creating meters.
DefaultInstrumentationName = "github.com/mahboubii/grpcmetrics"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements https://pkg.go.dev/google.golang.org/grpc/stats#Handler
func (*Handler) HandleConn ¶
HandleConn exists to satisfy gRPC stats.Handler interface.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option applies an option value when creating a Handler.
func WithInstrumentLatency ¶
WithInstrumentLatency enable instrument for rpc.{server|client}.duration. This is a histogram which is quite costly.
func WithInstrumentSizes ¶
WithInstrumentSizes enable instrument for rpc.{server|client}.response.size and rpc.{server|client}.request.size. This is a histogram which is quite costly.
func WithInstrumentationName ¶
WithInstrumentationName returns an Option to set custom name for metrics scope.
func WithMeterProvider ¶
func WithMeterProvider(p metric.MeterProvider) Option
WithMeterProvider returns an Option to use custom MetricProvider when creating metrics.
Click to show internal directories.
Click to hide internal directories.