Skip to content

feat(propagation): propagate TRACESTATE and BAGGAGE via standard propagators #34

Description

@tobert

Part of #31 (mirrors equinix-labs/otel-cli#390). Follow-up to the envcar TRACEPARENT adoption — same plumbing.

Today otel-cli handles only TRACEPARENT; TRACESTATE is hardcoded to "" (otlpclient/protobuf_span.go) and BAGGAGE is absent. exec only strips/re-adds TRACEPARENT= from the child env.

Scope (passthrough)

  • Extend the composite propagator to propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}).
  • Carry tracestate through extract -> inject so child processes receive it (TraceContext propagator already round-trips tracestate via the SpanContext).
  • Carry baggage through extract -> inject via the Baggage propagator + envcar.Carrier.
  • In exec.go, stop special-casing only TRACEPARENT — let the carrier own which keys it writes so we don't double-emit or drop TRACESTATE/BAGGAGE.

Explicitly out of scope (decided)

  • Recording baggage as span attributes.
  • Setting tracestate on otel-cli's own emitted spans.
    (Propagation passthrough only; can be revisited in a separate issue if wanted.)

Tests

  • Functional roundtrip for TRACESTATE through otel-cli exec.
  • Functional roundtrip for BAGGAGE through otel-cli exec.
  • Key-normalization behavior per the env-carriers spec.

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