Documentation ¶
Index ¶
- func NewClientHandler(options ...Option) stats.Handler
- func NewServerHandler(options ...Option) stats.Handler
- type ClientHandler
- func (c *ClientHandler) HandleConn(_ context.Context, _ stats.ConnStats)
- func (c *ClientHandler) HandleRPC(ctx context.Context, rpcStats stats.RPCStats)
- func (c *ClientHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
- func (c *ClientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
- type Option
- type ServerHandler
- func (s *ServerHandler) HandleConn(_ context.Context, _ stats.ConnStats)
- func (s *ServerHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)
- func (s *ServerHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
- func (s *ServerHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientHandler ¶
func NewServerHandler ¶
Types ¶
type ClientHandler ¶
type ClientHandler struct {
// contains filtered or unexported fields
}
ClientHandler implements https://pkg.go.dev/google.golang.org/grpc/stats#ServerHandler It records OpenTelemetry metrics and traces.
func (*ClientHandler) HandleConn ¶
func (c *ClientHandler) HandleConn( _ context.Context, _ stats.ConnStats, )
func (*ClientHandler) HandleRPC ¶
func (c *ClientHandler) HandleRPC( ctx context.Context, rpcStats stats.RPCStats, )
func (*ClientHandler) TagConn ¶
func (c *ClientHandler) TagConn( ctx context.Context, _ *stats.ConnTagInfo, ) context.Context
func (*ClientHandler) TagRPC ¶
func (c *ClientHandler) TagRPC( ctx context.Context, info *stats.RPCTagInfo, ) context.Context
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option applies an option value when creating a Handler.
func SetInstrumentationName ¶
func SetNamespace ¶
func SetServiceName ¶
func WithMeterProvider ¶
func WithMeterProvider(m metric.MeterProvider) Option
func WithPropagators ¶
func WithPropagators(p propagation.TextMapPropagator) Option
func WithTraceProvider ¶
func WithTraceProvider(t trace.TracerProvider) Option
type ServerHandler ¶
type ServerHandler struct {
// contains filtered or unexported fields
}
ServerHandler implements https://pkg.go.dev/google.golang.org/grpc/stats#ServerHandler It records OpenTelemetry metrics and traces.
func (*ServerHandler) HandleConn ¶
func (s *ServerHandler) HandleConn(_ context.Context, _ stats.ConnStats)
HandleConn processes the Conn stats.
func (*ServerHandler) HandleRPC ¶
func (s *ServerHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)
HandleRPC processes the RPC stats.
func (*ServerHandler) TagConn ¶
func (s *ServerHandler) TagConn( ctx context.Context, _ *stats.ConnTagInfo, ) context.Context
TagConn can attach some information to the given context.
func (*ServerHandler) TagRPC ¶
func (s *ServerHandler) TagRPC( ctx context.Context, info *stats.RPCTagInfo, ) context.Context
Click to show internal directories.
Click to hide internal directories.