tracing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = config.GetConfig()

Functions

func AddBaggage

func AddBaggage(ctx context.Context, key string, value string) context.Context

func GetTraceIDFromSpan

func GetTraceIDFromSpan(span trace.Span) string

func GetTracer

func GetTracer() *sdktrace.TracerProvider

GetTracer returns the globally initialized tracer provider

func NewTracer

func NewTracer() (*sdktrace.TracerProvider, error)

NewTracer initializes the tracer directly

func NewTracingMidleware

func NewTracingMidleware() gin.HandlerFunc

Types

type SpanWrapper

type SpanWrapper struct {
	trace.Span
}

func NewSpanWrapper

func NewSpanWrapper(ctx context.Context, name string) (context.Context, *SpanWrapper)

func (*SpanWrapper) GetTraceID

func (s *SpanWrapper) GetTraceID() string

func (*SpanWrapper) LogError

func (s *SpanWrapper) LogError(err error)

func (*SpanWrapper) WithStandardAttributes

func (s *SpanWrapper) WithStandardAttributes(ctx context.Context) *SpanWrapper

WithStandardAttributes adds standard attributes like user ID, request ID, etc.

Jump to

Keyboard shortcuts

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