trace

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 11 Imported by: 12

Documentation

Index

Constants

View Source
const TraceIDLogKey = "traceID"

Variables

This section is empty.

Functions

func ExtractMQHeader

func ExtractMQHeader(tracer opentracing.Tracer, msg *clusterSarama.ConsumerMessage) (opentracing.SpanContext, error)

func FromIncomingHeaders

func FromIncomingHeaders(headers []*clusterSarama.RecordHeader) metadata.MD

func Init

func Init(defaultSrvName string, cfg config.Configuration, options ...config.Option) (opentracing.Tracer, io.Closer)

Init returns an instance of Jaeger Tracer that samples 100% of traces and logs all spans to stdout.

func InjectMQHeader

func InjectMQHeader(tracer opentracing.Tracer, sm opentracing.SpanContext, ctx context.Context, msg *sarama.ProducerMessage)

func NewOutgoingHeaders

func NewOutgoingHeaders(h []sarama.RecordHeader, md metadata.MD) []sarama.RecordHeader

将map[string][]string数据格式转换为[]struct{[]byte, []byte}格式

func OpenTracingServerMiddleWare

func OpenTracingServerMiddleWare() gin.HandlerFunc

func OpentracingClientInterceptor

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

func OpentracingServerInterceptor

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

Types

type TextMapRW

type TextMapRW struct {
	metadata.MD
}

Opentracing About

func (TextMapRW) ForeachKey

func (t TextMapRW) ForeachKey(handler func(key, val string) error) error

func (TextMapRW) Set

func (t TextMapRW) Set(key, val string)

Jump to

Keyboard shortcuts

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