telemetry

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled added in v0.19.0

func Enabled() bool

Enabled returns true if tracing has been initialized.

func FinishSpan added in v0.19.0

func FinishSpan(span trace.Span, err *error)

FinishSpan ends a span and sets its status based on the error. Usage: defer telemetry.FinishSpan(span, &err)

func FormatTraceContext

func FormatTraceContext(spanCtx trace.SpanContext) (traceparent, tracestate string)

FormatTraceContext formats a span context into W3C Trace Context format.

func Initialize added in v0.19.0

func Initialize(ctx context.Context, endpoint string, insecure bool) error

Initialize sets up the OpenTelemetry tracer with OTLP HTTP exporter. This should be called once at application startup. Returns an error if initialization fails, or nil if tracing is disabled (empty endpoint).

func ParseTraceContext

func ParseTraceContext(traceparent, tracestate string) (context.Context, error)

ParseTraceContext parses W3C Trace Context headers (traceparent and tracestate) and returns a context with the extracted trace information.

func SetLeewayVersion

func SetLeewayVersion(version string)

SetLeewayVersion sets the leeway version for telemetry reporting

func Shutdown

func Shutdown(ctx context.Context) error

Shutdown flushes any pending spans and shuts down the tracer provider.

func StartSpan added in v0.19.0

func StartSpan(ctx context.Context, name string, attrs ...attribute.KeyValue) (context.Context, trace.Span)

StartSpan creates a new span with the given name and attributes.

func Tracer added in v0.19.0

func Tracer() trace.Tracer

Tracer returns the global tracer for leeway.

func ValidateTraceParent

func ValidateTraceParent(traceparent string) error

ValidateTraceParent validates the format of a traceparent header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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