plugin

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const JAEGER_KEY = "uber-trace-id"

Variables

This section is empty.

Functions

func GenerateSpanByMd

func GenerateSpanByMd(md map[string]string, operationName string) (opentracing.Span, map[string]string, error)

不破坏原数据,返回追加了Jaeger_key的数据

func GenerateSpanWithContext

func GenerateSpanWithContext(ctx context.Context, operationName string) (opentracing.Span, context.Context, error)

只适用于 jaeger 原理用 context 传递 "__req_metadata":""uber-trace-id -> 6f8b8a1101b0124f:6f8b8a1101b0124f:0000000000000000:1

uber-trace-id traceID : spanID : parentID: sampled bool

func GenerateSpanWithMap

func GenerateSpanWithMap(md2 map[string]string, operationName string) (opentracing.Span, map[string]string, error)

func GetTraceIDFromMd added in v1.0.4

func GetTraceIDFromMd(md map[string]string) string

GetTraceIDFromMd 从 metadata map 中提取 trace_id metadata 中 uber-trace-id 格式: traceID:spanID:parentID:sampled

func GetTraceIDFromSpan added in v1.0.4

func GetTraceIDFromSpan(span opentracing.Span) string

GetTraceIDFromSpan 从 opentracing.Span 中提取 trace_id

func NewTracer

func NewTracer(servicename string, addr string) (opentracing.Tracer, io.Closer, error)

Types

type JaegerPlugin

type JaegerPlugin struct {
	// contains filtered or unexported fields
}

func NewJaegerPlugin

func NewJaegerPlugin(t opentracing.Tracer) *JaegerPlugin

func (*JaegerPlugin) PostReadRequest

func (p *JaegerPlugin) PostReadRequest(ctx context.Context, r *protocol.Message, e error) error

func (*JaegerPlugin) PostWriteResponse

func (p *JaegerPlugin) PostWriteResponse(ctx context.Context, req *protocol.Message, res *protocol.Message, e error) error

type RecordPlugin

type RecordPlugin struct {
	// contains filtered or unexported fields
}

func NewRecordPlugin

func NewRecordPlugin(slog slog.Slog) *RecordPlugin

func (*RecordPlugin) PostCall

func (p *RecordPlugin) PostCall(ctx context.Context, serviceName, methodName string, args, reply interface{}, err error) (interface{}, error)

func (*RecordPlugin) PreCall

func (p *RecordPlugin) PreCall(ctx context.Context, serviceName, methodName string, args interface{}) (interface{}, error)

Jump to

Keyboard shortcuts

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