Describe your environment
- OS: Amazon Linux 2 (AWS Lambda)
- Python version: 3.11
- SDK version: opentelemetry-sdk==1.33.0
- Relevant packages: opentelemetry-instrumentation-aws-lambda
What happened?
The W3CBaggagePropagator fails to extract baggage context when the HTTP header name is title-cased (Baggage) instead of lowercase (baggage). This occurs when requests pass through AWS API Gateway, which normalizes header names to title case.
Per RFC 7230 and the W3C Baggage specification, HTTP header names are case-insensitive. The propagator should perform case-insensitive header lookup.
Steps to Reproduce
- Deploy a Python Lambda function with OpenTelemetry instrumentation and W3CBaggagePropagator
- Send a request with
baggage header via two different methods:
- Method A: Via AWS API Gateway (e.g., using k6 load test tool)
- Method B: Via AWS Lambda Test UI (direct invocation)
- Observe that baggage extraction works in one case but not the other
Expected Result
Baggage should be extracted regardless of header name casing (baggage, Baggage, BAGGAGE, etc.)
Actual Result
Via AWS Lambda Test UI (works) - header stays lowercase:
Request headers: {'baggage': 'city_id=123456,env=MY_ENV,root_endpoint=my-service-handler'}
Extracted baggage: {'city_id': '123456', 'env': 'MY_ENV', 'root_endpoint': 'my-service-handler'}
Via API Gateway with k6 (fails) - header is title-cased:
Request headers: {'Baggage': 'city_id=123456,env=MY_ENV,root_endpoint=my-service-handler'}
Extracted baggage: {} # Empty - baggage not extracted
AWS API Gateway normalizes HTTP header names to title case (baggage → Baggage), causing the extraction to fail.
Additional context
No response
Would you like to implement a fix?
Yes
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Describe your environment
What happened?
The
W3CBaggagePropagatorfails to extract baggage context when the HTTP header name is title-cased (Baggage) instead of lowercase (baggage). This occurs when requests pass through AWS API Gateway, which normalizes header names to title case.Per RFC 7230 and the W3C Baggage specification, HTTP header names are case-insensitive. The propagator should perform case-insensitive header lookup.
Steps to Reproduce
baggageheader via two different methods:Expected Result
Baggage should be extracted regardless of header name casing (
baggage,Baggage,BAGGAGE, etc.)Actual Result
Via AWS Lambda Test UI (works) - header stays lowercase:
Via API Gateway with k6 (fails) - header is title-cased:
AWS API Gateway normalizes HTTP header names to title case (
baggage→Baggage), causing the extraction to fail.Additional context
No response
Would you like to implement a fix?
Yes
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.