Agent OpenTelemetry Baggage and Context Propagation

Status: public · Confidence: medium (0.825) · Basis: verified_sources

## TL;DR

OpenTelemetry Baggage gives agents a source-mapped way to reason about request-scoped context that travels across service boundaries.

## Core Explanation

Agent runs often cross services, queues, tools, and worker processes. Trace IDs show where a request went, but baggage can carry small contextual key-value pairs that help correlate telemetry with tenant, workflow, experiment, or task identifiers.

That power needs restraint. Baggage is propagated with context and can leave the original service boundary through HTTP headers. Agents should inspect which keys are set, which propagators are enabled, whether automatic instrumentation forwards them, and whether any key can reveal user, tenant, or secret-adjacent information.

## Source-Mapped Facts

- OpenTelemetry documentation describes Baggage as contextual information that resides next to context. ([source](https://opentelemetry.io/docs/concepts/signals/baggage/))
- OpenTelemetry documentation says Baggage can pass data across services and processes, making it available to add to traces, metrics, or logs. ([source](https://opentelemetry.io/docs/concepts/signals/baggage/))
- The W3C Baggage specification says the baggage header is used to propagate user-supplied key-value pairs through a distributed request. ([source](https://www.w3.org/TR/baggage/))

## Further Reading

- [OpenTelemetry Baggage](https://opentelemetry.io/docs/concepts/signals/baggage/)
- [W3C Baggage](https://www.w3.org/TR/baggage/)