opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

Don't normalize headers with "hyphen -> underscore"

Open Kludex opened this issue 11 months ago • 5 comments
trafficstars

I think this can be considered a breaking change, and I'm not sure how it affects other services, but it fixes the behavior according to the OTel specification.

Changes

  • [X] Remove replace - to _ on the HTTP header normalizer.
  • [X] Update test suite.
  • [X] Update documentation.

Details

The current behavior is incorrect according to the HTTP RFCs regarding HTTP headers (because they are just case-insensitive), and the OpenTelemetry specification itself.

Screenshot 2024-12-13 at 11 19 26

The following headers are not the same:

Content-Type: application/json
Content_Type: application/json

But those two, should be treated as same:

Content-Type: application/json
content-type: application/json

Kludex avatar Dec 13 '24 10:12 Kludex