Documentation
¶
Index ¶
Constants ¶
View Source
const ( ReceivedEvents = otelgrpc.ReceivedEvents SentEvents = otelgrpc.SentEvents )
Variables ¶
This section is empty.
Functions ¶
func NewClientStatsHandler ¶
NewClientStatsHandler creates an OTel stats handler for the client.
func NewServerStatsHandler ¶
NewServerStatsHandler creates an OTel stats handler for the server.
Types ¶
type Option ¶
Option is a type alias so users don't need to import the otelgrpc package.
func WithFilter ¶
func WithFilter(filter func(info *stats.RPCTagInfo) bool) Option
WithFilter configures a filter to ignore specific requests based on the RPC tag info.
func WithMessageEvents ¶
WithMessageEvents configures the handler to record the specified events (span.AddEvent) on spans.
Valid events are:
- ReceivedEvents: Record the number of bytes read.
- SentEvents: Record the number of bytes written.
func WithMetricAttributes ¶
WithMetricAttributes configures custom attributes for the metrics.
func WithSpanAttributes ¶
WithSpanAttributes configures custom attributes for the spans.
Click to show internal directories.
Click to hide internal directories.