Involved Source Files Package grpctraces provides [stats.Handler] instrumentation for gRPC clients
and servers using [traces.Tracer].handler.gostatus.go
Package-Level Type Names (total 2, in which 1 is exported)
/* sort exporteds by: | */
Handler implements the [stats.Handler] interface for gRPC clients and
servers.attrsfunc(ctx context.Context, info *stats.RPCTagInfo) []traces.Attrextractfunc(get func(key string) []string) traces.SpanReffilterfunc(ctx context.Context, info *stats.RPCTagInfo) boolinjectfunc(ref traces.SpanRef, set func(key, value string))serverboolspanNamefunc(ctx context.Context, info *stats.RPCTagInfo) stringtracer*traces.Tracer HandleConn implements the [stats.Handler] interface. HandleRPC implements the [stats.Handler] interface, finishing the span on
[stats.End]. TagConn implements the [stats.Handler] interface. TagRPC implements the [stats.Handler] interface. WithAttrs returns a [Handler] using f to attach additional start-time
attributes for each RPC. If f is nil, only default attributes are added. WithExtract returns a [Handler] using f to extract the parent
[traces.SpanRef] from incoming metadata (for example [traceparent.Extract]).
If f is nil, incoming metadata is ignored. WithFilter returns a [Handler] that only traces RPCs for which f returns
true. Filtered-out RPCs do not create spans or inject trace metadata. If f is
nil, all RPCs are traced. WithInject returns a [Handler] using f to inject [traces.SpanRef] into
outgoing metadata (for example [traceparent.Inject]). If f is nil, no trace
metadata is injected. WithSpanName returns a [Handler] using f to compute the span name from the
RPC tag info. If f is nil, it restores using rpc.method (falling back to
"grpc").
*Handler : google.golang.org/grpc/stats.Handler
func NewClientHandler(tr *traces.Tracer) *Handler
func NewServerHandler(tr *traces.Tracer) *Handler
func (*Handler).WithAttrs(f func(ctx context.Context, info *stats.RPCTagInfo) []traces.Attr) *Handler
func (*Handler).WithExtract(f func(get func(key string) []string) traces.SpanRef) *Handler
func (*Handler).WithFilter(f func(ctx context.Context, info *stats.RPCTagInfo) bool) *Handler
func (*Handler).WithInject(f func(ref traces.SpanRef, set func(key, value string))) *Handler
func (*Handler).WithSpanName(f func(ctx context.Context, info *stats.RPCTagInfo) string) *Handler
Package-Level Functions (total 5, in which 2 are exported)
NewClientHandler returns a new [Handler] instance for tracing outgoing gRPC
RPCs. Outgoing metadata is not modified by default; call [Handler.WithInject]
to opt in to trace context injection.
NewServerHandler returns a new [Handler] instance for tracing incoming gRPC
RPCs. Incoming metadata is ignored by default; call [Handler.WithExtract] to
opt in to trace context extraction.