Documentation ¶
Index ¶
- Constants
- func Extract(ctx context.Context, tracer trc.Tracer, request *fasthttp.Request) (rCtx context.Context, span trc.Span)
- func Inject(ctx context.Context, tracer trc.Tracer, request *fasthttp.Request) (context.Context, trc.Span)
- func StartAgent(c AgentConfig) (func(ctx context.Context) error, error)
- type AgentConfig
- type TraceCollector
Constants ¶
View Source
const ( TraceIdHeaderKey string = "trace-id" SpanIdHeaderKey string = "span-id" )
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
func Extract(ctx context.Context, tracer trc.Tracer, request *fasthttp.Request) (rCtx context.Context, span trc.Span)
extract trace and span id from header, if trace id not exist create new span context for start new tracer and return trace span
func Inject ¶
func Inject(ctx context.Context, tracer trc.Tracer, request *fasthttp.Request) (context.Context, trc.Span)
inject trace id and span id to request header and start new tracer
func StartAgent ¶
func StartAgent(c AgentConfig) (func(ctx context.Context) error, error)
start new connection to collector server for now only support otpl that using jaeger and prometheus
Types ¶
type AgentConfig ¶
type AgentConfig struct { Collector TraceCollector Endpoint string Environment string Name string Version string }
Click to show internal directories.
Click to hide internal directories.