Back to

Package tracer

Latest Go to latest

The latest major version is .

Published: 2 days ago | License: MIT | Module:



var (

	// ErrConfigConvert 配置转换失败
	ErrConfigConvert = errors.New("Convert linker config")

func ClientInterceptor

func ClientInterceptor(tracer opentracing.Tracer) grpc.UnaryClientInterceptor

ClientInterceptor rpc拦截器

func GetGRPCServerTracer

func GetGRPCServerTracer() grpc.ServerOption

GetGRPCServerTracer 获取GRPC Server拦截器

func NewSlowReporter

func NewSlowReporter(sender jaeger.Transport, metrics *jaeger.Metrics, probabilistic float64) jaeger.Reporter

NewSlowReporter creates a new reporter that sends spans out of process by means of Sender.

type HTTPTracer

type HTTPTracer struct {
	// contains filtered or unexported fields

HTTPTracer http request tracer

func (*HTTPTracer) Begin

func (t *HTTPTracer) Begin(ectx echo.Context)

Begin 开始捕捉

func (*HTTPTracer) End

func (t *HTTPTracer) End(ectx echo.Context)

End 结束捕捉

type MDReaderWriter

type MDReaderWriter struct {

MDReaderWriter metadata 读写

func (MDReaderWriter) ForeachKey

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

ForeachKey 为了 opentracing.TextMapReader ,参考 opentracing 代码

func (MDReaderWriter) Set

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

Set 为了 opentracing.TextMapWriter,参考 opentracing 代码

type Option

type Option func(*Tracer)

Option config wraps

func WithHTTP

func WithHTTP(CollectorEndpoint string) Option


func WithProbabilistic

func WithProbabilistic(probabilistic float64) Option

WithProbabilistic 采样率 0 ~ 1

func WithSlowRequest

func WithSlowRequest(ms int) Option

WithSlowRequest 单次请求阀值(超过会有慢日志

func WithSlowSpan

func WithSlowSpan(ms int) Option

WithSlowSpan 单次调用阀值(超过会有慢日志

func WithUDP

func WithUDP(LocalAgentHostPort string) Option


type RedisTracer

type RedisTracer struct {
	Cmd string
	// contains filtered or unexported fields

RedisTracer redis tracer

func (*RedisTracer) Begin

func (r *RedisTracer) Begin(ctx context.Context)

Begin 开始监听

func (*RedisTracer) End

func (r *RedisTracer) End()

End 结束监听

type TraceKey

type TraceKey int

TraceKey 主键类型

const (
	// RequestKey 请求的键值
	RequestKey TraceKey = 1000 + iota

type Tracer

type Tracer struct {
	// contains filtered or unexported fields

Tracer tracer struct

func New

func New(name string, protoOpt Option, opts ...Option) (*Tracer, error)

New 创建 jaeger traing

func (*Tracer) Close

func (t *Tracer) Close()

Close 关闭tracing

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier