otel

package
v0.0.0-...-4a59535 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientHandler

func NewClientHandler(options ...Option) stats.Handler

func NewServerHandler

func NewServerHandler(options ...Option) stats.Handler

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 SetInstrumentationName(v string) Option

func SetNamespace

func SetNamespace(v string) Option

func SetServiceName

func SetServiceName(v string) Option

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

Jump to

Keyboard shortcuts

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