otlp

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package otlp implements ADR 0050 Level 2: best-effort OTLP/HTTP export of the Level 1 telemetry artifacts. Export is a pure function of the run directory — run-telemetry.jsonl and run-summary.json are replayed into OpenTelemetry span snapshots and sent through the OTel Go SDK's OTLP/HTTP exporter — so the exported trace is, by construction, the same trace the local files record.

The package never affects the run: it is inert unless a standard OTEL_EXPORTER_OTLP_(TRACES_)ENDPOINT is configured, every network operation is bounded by a hard wall-clock deadline, and all failures are returned as an error the caller may surface as a warning — the exit code and the Level 1 artifacts are never touched. "Non-blocking flush" is implemented as a bounded flush: a fire-and-forget goroutine would be killed at process exit and silently lose every span.

All endpoint, header, TLS, timeout, and compression configuration is delegated to the exporter's standard env-var handling, which matches the contract published in docs/guides/infrastructure/distributed-tracing.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled() bool

Enabled reports whether an OTLP traces endpoint is configured.

func ExportRunDir

func ExportRunDir(dir, serviceVersion string) error

ExportRunDir exports the completed spans recorded in dir's Level 1 artifacts. It is a no-op (nil) when no endpoint is configured, when the standard kill switches (OTEL_SDK_DISABLED, OTEL_TRACES_EXPORTER=none) are set, when the run's trace is unsampled (W3C sampled bit unset — an upstream sampling decision must be respected), or when the artifacts are missing or contain no completed spans. It never blocks longer than exportTimeout and never modifies anything in dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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