opentracing

package
v0.0.0-...-3481ce3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOpentracing

func NewOpentracing(opts ...Option) middleware.Middleware

NewOpentracing 创建链路追踪器

Types

type MDReaderWriter

type MDReaderWriter struct {
	metadata.MD
}

MDReaderWriter metadata Reader and Writer

func (MDReaderWriter) ForeachKey

func (c MDReaderWriter) ForeachKey(handler func(key, val string) error) error

ForeachKey range all keys to call handler

func (MDReaderWriter) Set

func (c MDReaderWriter) Set(key, val string)

Set implements Set() of opentracing.TextMapWriter

type Opentracing

type Opentracing struct {
	Options *Options
}

Opentracing 链路追踪中间件

func (*Opentracing) StreamClient

func (trace *Opentracing) StreamClient(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (cs grpc.ClientStream, err error)

StreamClient 流式服客户中间件 grpc.StreamClientInterceptor

func (*Opentracing) StreamHandler

func (trace *Opentracing) StreamHandler(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)

StreamHandler 流式中间件

func (*Opentracing) UnaryClient

func (trace *Opentracing) UnaryClient(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error)

UnaryClient 非流式客户端中间件 grpc.UnaryClientInterceptor

func (*Opentracing) UnaryHandler

func (trace *Opentracing) UnaryHandler(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

UnaryHandler 非流式中间件

type Option

type Option func(*Options)

Option 实例值设置

func FilterOutFunc

func FilterOutFunc(filterOutFunc middleware.FilterFunc) Option

FilterOutFunc 设置中间件忽略函数列表

func Logger

func Logger(logger *zap.SugaredLogger) Option

Logger 设置日志对象

func Tracer

func Tracer(tracer opentracing.Tracer) Option

Tracer 链路追踪客户端

type Options

type Options struct {
	FilterOutFunc middleware.FilterFunc
	Logger        *zap.SugaredLogger
	Tracer        opentracing.Tracer
}

Options 注册相关参数

Jump to

Keyboard shortcuts

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