grpc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 11 Imported by: 31

Documentation

Overview

Package grpc contains several gRPC handlers which can be used for instrumenting calls with Zipkin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientHandler

func NewClientHandler(tracer *zipkin.Tracer, options ...ClientOption) stats.Handler

NewClientHandler returns a stats.Handler which can be used with grpc.WithStatsHandler to add tracing to a gRPC client. The gRPC method name is used as the span name and by default the only tags are the gRPC status code if the call fails.

func NewServerHandler added in v0.1.5

func NewServerHandler(tracer *zipkin.Tracer, options ...ServerOption) stats.Handler

NewServerHandler returns a stats.Handler which can be used with grpc.WithStatsHandler to add tracing to a gRPC server. The gRPC method name is used as the span name and by default the only tags are the gRPC status code if the call fails. Use ServerTags to add additional tags that should be applied to all spans.

Types

type ClientOption

type ClientOption func(*clientHandler)

A ClientOption can be passed to NewClientHandler to customize the returned handler.

func WithRemoteServiceName added in v0.1.5

func WithRemoteServiceName(name string) ClientOption

WithRemoteServiceName will set the value for the remote endpoint's service name on all spans.

type RPCHandler

type RPCHandler func(span zipkin.Span, rpcStats stats.RPCStats)

A RPCHandler can be registered using WithClientRPCHandler or WithServerRPCHandler to intercept calls to HandleRPC of a handler for additional span customization.

type ServerOption added in v0.1.5

type ServerOption func(*serverHandler)

A ServerOption can be passed to NewServerHandler to customize the returned handler.

func EnableBaggage added in v0.4.0

func EnableBaggage(b middleware.BaggageHandler) ServerOption

EnableBaggage can be passed to NewServerHandler to enable propagation of registered fields through the SpanContext object.

func ServerTags added in v0.1.5

func ServerTags(tags map[string]string) ServerOption

ServerTags adds default Tags to inject into server spans.

Jump to

Keyboard shortcuts

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