Fix HTTP header normalization#2260
Conversation
|
Thanks for the PR @samuelcolvin. I did some digging and it looks like the OTel conventions were changed in open-telemetry/semantic-conventions#369 but used to require this normalization. We should definitely fix it, but I think it might need to be gated behind the @lmolkova @lzchen could we merge this PR today or does it need to be controlled by |
|
This might be a bigger discussion on how we should be handling the new http semantic convention migrations. For now, please hold off on this PR. Will bring this up in the weekly SIG. |
Running now
That SGTM as it's just a bug 👍 |
|
From discussion of 07/11/2024 SIG, just an update on what is blocking this PR. Some of the instrumentations that this pr touches still has not been migrated to new semantic conventions as of yet, most notably django, falcon, pyramid, starlette and tornado. Since |
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
|
This PR has been closed due to inactivity. Please reopen if you would like to continue working on it. |
Description
HTTP request and response headers (attributes
http.request.header.*andhttp.response.header.*) should be normalized by just being converted to lowercase, not replacing underscore with dash.This is made clear in the docs here:
You can also see the correct behavior in the go library here.
The current incorrect behavior of
replace('_', '-')is extremely problematic since you can't know what the original header was - e.g. if you see a keyhttp.request.header.foo_barwhat was the original value? It could have beenfoo-barorfoo_bar.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.