trace

package
v0.0.0-...-8964234 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 14 Imported by: 0

README

Embed Trace

config
import "github.com/uber/jaeger-client-go/config"

cfg := config.Configuration{
		Sampler: &config.SamplerConfig{
			Type:                    jaeger.SamplerTypeConst,
			Param:                   1,
			SamplingRefreshInterval: time.Second,
		},
		Reporter: &config.ReporterConfig{
			LogSpans:            true,
			LocalAgentHostPort:  "127.0.0.1:5775",
			BufferFlushInterval: time.Second,
		},
	}
    
init
    InitByConfig(serviceName, cfg)
trace
    span, ctx := opentracing.StartSpanFromContext(context.Background(), "name")
    span.Finish()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientWrapper

func ClientWrapper() client.CallWrapper

func ExtractSpanContextFromContext

func ExtractSpanContextFromContext(ctx context.Context, tracer opentracing.Tracer) (opentracing.SpanContext, error)

func ExtractSpanContextFromMQHeader

func ExtractSpanContextFromMQHeader(header amqp.Table, tracer opentracing.Tracer) (opentracing.SpanContext, error)

func ExtractSpanFromContext

func ExtractSpanFromContext(ctx context.Context, tracer opentracing.Tracer, operationName string) opentracing.Span

func ExtractSpanFromMQHeader

func ExtractSpanFromMQHeader(header amqp.Table, tracer opentracing.Tracer, name string) (sp opentracing.Span)

func GRPCServerWrapper

func GRPCServerWrapper()

func Init

func Init(serviceName string) (io.Closer, error)

this method will initial global tracer if no call global tracer default no-op tracer init config from key:value

func InitByConfig

func InitByConfig(serviceName string, cfg jCfg.Configuration) (io.Closer, error)

func InjectSpanContextToContext

func InjectSpanContextToContext(ctx context.Context, tracer opentracing.Tracer, spanContext opentracing.SpanContext) (context.Context, error)

func InjectSpanContextToMQHeader

func InjectSpanContextToMQHeader(header amqp.Table, tracer opentracing.Tracer, spanContext opentracing.SpanContext) error

func InjectSpanToContext

func InjectSpanToContext(ctx context.Context, span opentracing.Span) (context.Context, error)

func InjectSpanToMQHeader

func InjectSpanToMQHeader(header amqp.Table, span opentracing.Span) error

func ServerWrapper

func ServerWrapper() server.HandlerWrapper

Types

type MQTextMapCarrier

type MQTextMapCarrier amqp.Table

func (MQTextMapCarrier) ForeachKey

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

func (MQTextMapCarrier) Set

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

Jump to

Keyboard shortcuts

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