What is baggage, and how is it different from span attributes?
IntermediateConceptTracing & OpenTelemetry
Answer
Baggage is a set of key/value pairs propagated with the request across process boundaries (the baggage HTTP header), for example tenant.id=acme. Every downstream service can read it.
Span attributes live only on one span and are never propagated.
Baggage is not automatically recorded on spans; you add a processor (or in the Collector, copy it) if you want it as an attribute. Cautions: it travels on every outbound call, including to third parties, so never put secrets or PII in it, and keep it small because it adds bytes to every request.
baggage: tenant.id=acme,plan=enterprise
More on Tracing & OpenTelemetry
What is distributed tracing, and what are a trace, a span and a span context?BeginnerWhat fields does an OpenTelemetry span carry?BeginnerWhat are span kinds and why do they matter?IntermediateWhat does the W3C `traceparent` header look like?IntermediateWhat is OpenTelemetry and what are its main parts?BeginnerWhy does OpenTelemetry separate the API from the SDK?Advanced