opencloud icon indicating copy to clipboard operation
opencloud copied to clipboard

update otlp tracing

Open butonic opened this issue 1 month ago • 0 comments

proposal to fix https://github.com/opencloud-eu/opencloud/issues/1906

We can rely on the otlp SDK to parse and configure the traces provider. The only env var we need to handle is OTEL_TRACES_EXPORTER to decide which exporter to initialize. The new env var defaults to none but can be set to console or otlp.

When set to otlp the default env vars can be used to configure it:

// - OTEL_EXPORTER_OTLP_ENDPOINT
// - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT (takes precedence)
// - OTEL_EXPORTER_OTLP_HEADERS
// - OTEL_EXPORTER_OTLP_INSECURE
// - OTEL_EXPORTER_OTLP_CERTIFICATE (for custom CA)
// - OTEL_TRACES_SAMPLER
// - OTEL_TRACES_SAMPLER_ARG

See https://opentelemetry.io/docs/languages/sdk-configuration/general/ and https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/ for details.

To send the traces eg to jaeger (which supports otlp OOTB):

# Use OTLP exporter with all options
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=https://collector:4317
export OTEL_EXPORTER_OTLP_INSECURE=true
export OTEL_TRACES_SAMPLER=parentbased_traceidratio
export OTEL_TRACES_SAMPLER_ARG=0.1

The best part: +1.167 -28.652

butonic avatar Nov 26 '25 10:11 butonic