-
Notifications
You must be signed in to change notification settings - Fork 758
Closed
Labels
apiAffects the API package.Affects the API package.bugSomething isn't workingSomething isn't workinggood first issueGood first issueGood first issuehelp wanted
Description
opentelemetry.baggage.propagation.W3CBaggagePropagator is lowercasing keys in extract, as far as I can tell the W2C baggage spec does not define this behavior.
I also confirmed the go implementation does not lowercase keys: https://go.dev/play/p/9H4HKKmSRMA
I think just removing the .lower() here should fix it: https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py#L96
Steps to reproduce
from opentelemetry import baggage
from opentelemetry.baggage.propagation import W3CBaggagePropagator
carrier = {}
propagator = W3CBaggagePropagator()
ctx = baggage.set_baggage('userId', '1')
print(ctx)
propagator.inject(carrier, ctx)
print(carrier)
print(propagator.extract(carrier))What is the expected behavior?
{'baggage-ce2af44a-cf4d-4151-88a5-349b34d2c353': {'userId': '1'}}
{'baggage': 'userId=1'}
{'baggage-ce2af44a-cf4d-4151-88a5-349b34d2c353': {'userId': '1'}}
What is the actual behavior?
{'baggage-ce2af44a-cf4d-4151-88a5-349b34d2c353': {'userId': '1'}}
{'baggage': 'userId=1'}
{'baggage-ce2af44a-cf4d-4151-88a5-349b34d2c353': {'userid': '1'}} # note lowercased key
Metadata
Metadata
Assignees
Labels
apiAffects the API package.Affects the API package.bugSomething isn't workingSomething isn't workinggood first issueGood first issueGood first issuehelp wanted