grpc

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientHandler

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

NewClientHandler creates a stats.Handler for a gRPC client.

func NewServerHandler

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

NewServerHandler creates a stats.Handler for a gRPC server.

Types

type Event

type Event int

Event type that can be recorded, see WithMessageEvents.

const (
	ReceivedEvents Event = iota
	SentEvents
)

Different types of events that can be recorded, see WithMessageEvents.

type Filter

type Filter func(*stats.RPCTagInfo) bool

Filter is a predicate used to determine whether a given request in should be instrumented by the attached RPC tag info. A Filter must return true if the request should be instrumented.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option applies an option value for a config.

func WithFilter

func WithFilter(f Filter) Option

WithFilter returns an Option to use the request filter.

func WithMessageEvents

func WithMessageEvents(events ...Event) Option

WithMessageEvents configures the Handler to record the specified events (span.AddEvent) on spans. By default only summary attributes are added at the end of the request.

Valid events are:

  • ReceivedEvents: Record the number of bytes read after every gRPC read operation.
  • SentEvents: Record the number of bytes written after every gRPC write operation.

func WithPropagators

func WithPropagators(p propagation.TextMapPropagator) Option

WithPropagators returns an Option to use the Propagators when extracting and injecting trace context from requests.

func WithSpanOptions

func WithSpanOptions(opts ...trace.SpanStartOption) Option

WithSpanOptions configures an additional set of trace.SpanOptions, which are applied to each new span.

func WithTracerProvider

func WithTracerProvider(tp trace.TracerProvider) Option

WithTracerProvider returns an Option to use the TracerProvider when creating a Tracer.

Jump to

Keyboard shortcuts

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