grpc

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReceivedEvents = otelgrpc.ReceivedEvents
	SentEvents     = otelgrpc.SentEvents
)

Variables

This section is empty.

Functions

func NewClientStatsHandler

func NewClientStatsHandler(opts ...Option) stats.Handler

NewClientStatsHandler creates an OTel stats handler for the client.

func NewServerStatsHandler

func NewServerStatsHandler(opts ...Option) stats.Handler

NewServerStatsHandler creates an OTel stats handler for the server.

Types

type Event

type Event = otelgrpc.Event

type Option

type Option = otelgrpc.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

func WithMessageEvents(events ...Event) Option

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

func WithMetricAttributes(attrs ...attribute.KeyValue) Option

WithMetricAttributes configures custom attributes for the metrics.

func WithSpanAttributes

func WithSpanAttributes(attrs ...attribute.KeyValue) Option

WithSpanAttributes configures custom attributes for the spans.

Jump to

Keyboard shortcuts

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