telemetry

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatTraceContext

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

FormatTraceContext formats a span context into W3C Trace Context format. This is useful for propagating trace context to child processes.

func InitTracer

func InitTracer(ctx context.Context, endpoint string, insecure bool) (*sdktrace.TracerProvider, error)

InitTracer initializes the OpenTelemetry tracer with OTLP HTTP exporter. The endpoint parameter specifies the OTLP endpoint URL (e.g., "localhost:4318"). The insecure parameter controls whether to use TLS (false = use TLS, true = no TLS). Returns the TracerProvider which must be shut down when done.

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. Format: traceparent = "00-{trace-id}-{span-id}-{flags}"

func SetLeewayVersion

func SetLeewayVersion(version string)

SetLeewayVersion sets the leeway version for telemetry reporting

func Shutdown

func Shutdown(ctx context.Context, tp *sdktrace.TracerProvider) error

Shutdown flushes any pending spans and shuts down the tracer provider. It uses a timeout context to ensure shutdown completes within a reasonable time.

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