We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Observability Monitoring
Free preview: the first 2 parts of this 9-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Observability Monitoring
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
A platform team needed to route requests differently based on the customer's subscription tier, premium customers get priority queue processing, while free-tier users go through the standard path. The tier information lived in the auth service, but the routing decision happened 4 services downstream in the queue manager.
They could query the database from the queue manager, but that added latency and a database dependency to a service that didn't otherwise need one. They could pass the tier as a custom header, but they'd have to modify every service in between to forward it, even services that didn't use the information.
Baggage solves this. It's a set of key-value pairs that automatically propagates with the trace context through every service in the request path. Set customer.tier=premium in the auth service, and it's available in the queue manager, and every service in between, without any of them explicitly forwarding it.
Baggage uses the W3C Baggage header:
baggage: customer.tier=premium,region=us-east,experiment.group=B
Each entry is a key-value pair. The header is injected and extracted alongside the traceparent header by the same context propagation mechanism.
| Aspect | Trace Context | Baggage |
|---|---|---|
| Purpose | Trace correlation (IDs, sampling) | Arbitrary metadata propagation |
| Content | Trace ID, Span ID, flags | Custom key-value pairs |
| Header | traceparent | baggage |
| Set by | Tracing system automatically | Application code explicitly |
| Read by | Tracing system | Application code |
Common baggage use cases:
Baggage is not a replacement for application-level request headers. It's specifically for metadata that needs to travel through the entire distributed transaction automatically, without each intermediate service explicitly forwarding it.