Documentation ¶
Overview ¶
Package gtrace provides convenience wrapping functionality for tracing feature using OpenTelemetry.
Index ¶
- func CommonLabels() []label.KeyValue
- func GetBaggageVar(ctx context.Context, key string) *gvar.Var
- func GetSpanId(ctx context.Context) string
- func GetTraceId(ctx context.Context) string
- func IsActivated(ctx context.Context) bool
- func SetBaggageMap(ctx context.Context, data map[string]interface{}) context.Context
- func SetBaggageValue(ctx context.Context, key string, value interface{}) context.Context
- func Tracer(name ...string) trace.Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonLabels ¶
CommonLabels returns common used attribute labels: ip.intranet, hostname.
func GetBaggageVar ¶
GetBaggageVar retrieves value and returns a *gvar.Var for specified key from baggage.
func GetSpanId ¶
GetSpanId retrieves and returns SpanId from context. It returns an empty string is tracing feature is not activated.
func GetTraceId ¶
GetTraceId retrieves and returns TraceId from context. It returns an empty string is tracing feature is not activated.
func IsActivated ¶
IsActivated checks and returns if tracing feature is activated.
func SetBaggageMap ¶
SetBaggageMap is a convenient function for adding map key-value pairs to baggage. Note that it uses label.Any to set the key-value pair.
func SetBaggageValue ¶
SetBaggageValue is a convenient function for adding one key-value pair to baggage. Note that it uses label.Any to set the key-value pair.
Types ¶
This section is empty.