tracer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

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
}

type TraceCollector

type TraceCollector string
const (
	OtplCollector TraceCollector = "otpl"
)

Jump to

Keyboard shortcuts

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