package grpc

import "github.com/openzipkin/zipkin-go/middleware/grpc"

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

Index

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. Use WithRPCHandler to add additional tags.

Types

type ClientOption

type ClientOption func(*clientHandler)

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

func WithRPCHandler

func WithRPCHandler(handler RPCHandler) ClientOption

WithRPCHandler allows one to add custom logic for handling a stats.RPCStats, e.g., to add additional tags.

type RPCHandler

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

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

Source Files

client.go doc.go shared.go

Version
v0.1.4
Published
Dec 19, 2018
Platform
js/wasm
Imports
9 packages
Last checked
12 hours ago

Tools for package owners.