Skip to content

Align env-based context propagation with OTel env-carriers spec #31

Description

@tobert

Tracking issue

Align otel-cli's environment-variable context propagation with the OpenTelemetry env-carriers specification, adopting the shared Go carrier rather than maintaining custom carrier behavior.

Mirrors upstream equinix-labs/otel-cli#390 (filed by @pellared). We're tracking our own decomposition here.

Spec / library

Decisions for our fork

  • Adopt envcar (not a from-scratch reimplementation). We already depend directly on go.opentelemetry.io/otel + otel/sdk + otel/semconv, so a contrib propagator is a natural extension, not a foreign dependency.
  • envcar@v0.69.0 requires otel core v1.44.0 and Go 1.25 — so the dependency bump is a real, separately-tracked prerequisite.
  • TRACESTATE + BAGGAGE share the same composite-propagator plumbing, so they're folded into a single follow-up issue.

Already satisfied in our fork

  • exec already injects into a child env copy (otelcli/exec.go builds a separate childEnv; the parent environment is never mutated). The spec's "inject into the child process environment copy" ask needs no change beyond routing it through the carrier.

Sub-issues (do in order)

Out of scope (for now)

  • Recording baggage as span attributes / setting tracestate on emitted spans — propagation passthrough only unless we decide otherwise.
  • Replacing the otel-cli-specific --tp-* flags or the shell-sourceable tp-carrier file format; those stay and must keep working (clear migration path required).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions