tracing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tracing wires OpenTelemetry tracers, propagators, and optional OTLP export.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPMiddleware

func HTTPMiddleware(active bool, next http.Handler) http.Handler

HTTPMiddleware wraps the handler with otelhttp when tracing is active; otherwise returns next unchanged.

func WrapTransport

func WrapTransport(active bool, rt http.RoundTripper) http.RoundTripper

WrapTransport wraps the round tripper with otelhttp.NewTransport when active.

Types

type Result

type Result struct {
	Shutdown func(context.Context) error
	Active   bool
}

Result carries shutdown and whether tracing is active (SDK registered).

func Init

func Init(ctx context.Context, cfg *config.Config) (Result, error)

Init configures global propagators and, when cfg.Tracing.Enabled, an OTLP HTTP exporter and tracer provider. Export uses standard OTEL environment variables (OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_TRACES_EXPORTER, etc.).

Jump to

Keyboard shortcuts

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