gtrace

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 9 Imported by: 2

Documentation

Overview

Package gtrace provides convenience wrapping functionality for tracing feature using OpenTelemetry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonLabels

func CommonLabels() []label.KeyValue

CommonLabels returns common used attribute labels: ip.intranet, hostname.

func GetBaggageVar

func GetBaggageVar(ctx context.Context, key string) *gvar.Var

GetBaggageVar retrieves value and returns a *gvar.Var for specified key from baggage.

func GetSpanId

func GetSpanId(ctx context.Context) string

GetSpanId retrieves and returns SpanId from context. It returns an empty string is tracing feature is not activated.

func GetTraceId

func GetTraceId(ctx context.Context) string

GetTraceId retrieves and returns TraceId from context. It returns an empty string is tracing feature is not activated.

func IsActivated

func IsActivated(ctx context.Context) bool

IsActivated checks and returns if tracing feature is activated.

func SetBaggageMap

func SetBaggageMap(ctx context.Context, data map[string]interface{}) context.Context

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

func SetBaggageValue(ctx context.Context, key string, value interface{}) context.Context

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.

func Tracer

func Tracer(name ...string) trace.Tracer

Tracer is a short function for retrieve Tracer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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