otel

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package otel provides OpenTelemetry tracer provider initialization and management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitProvider

func InitProvider(cfg *config.OTELConfig, versionInfo string) (*sdktrace.TracerProvider, error)

InitProvider initializes the OpenTelemetry tracer provider and establishes connection to the OTLP endpoint. Returns error if initialization fails.

Uses OTLP/HTTP protocol. The HTTP client automatically honors HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables through Go's standard net/http transport.

TLS behavior: HTTPS by default for non-localhost endpoints. Set OTEL_EXPORTER_OTLP_INSECURE=true to force plain HTTP, or use an http:// scheme in the endpoint URL. Localhost endpoints default to insecure for convenience. TLS certificates, mTLS, headers, compression, and timeout are all configurable via standard OTEL_EXPORTER_OTLP_* env vars handled natively by the otlptracehttp library (see OTELConfig doc comment for full list).

func ShutdownProvider

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

ShutdownProvider gracefully shuts down the tracer provider, flushing any remaining spans.

Types

This section is empty.

Jump to

Keyboard shortcuts

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