fix(core): Normalize http header attribute keys according to OTel spec - #24222
Open
Lms24 wants to merge 1 commit into
Open
fix(core): Normalize http header attribute keys according to OTel spec#24222Lms24 wants to merge 1 commit into
Lms24 wants to merge 1 commit into
Conversation
Contributor
size-limit report 📦
|
Lms24
marked this pull request as ready for review
September 9, 2026 08:56
Lms24
requested review from
JPeer264,
mydea,
nicohrubec and
s1gr1d
and removed request for
a team
September 9, 2026 08:56
Lms24
force-pushed
the
lms/fix-core-http-header-normalization
branch
from
September 9, 2026 09:37
b8ba890 to
165ea84
Compare
Lms24
added this pull request to stack #24232
September 9, 2026 09:58
s1gr1d
approved these changes
Sep 9, 2026
s1gr1d
left a comment
Member
There was a problem hiding this comment.
You could also update the policy here just to mention that explicitly named keys are kept like they are: https://github.com/getsentry/sentry-conventions/blob/main/CONTRIBUTING.md#policies
Member
Author
|
Conventions update: getsentry/sentry-conventions#632 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, our
httpHeadersToSpanAttributeshelper, which we use to createhttp.(request|response).header.<key>attributes, normalized header names by 1. lower-casing them and 2. converting dashes in header names to underscores. The intention of this was to follow attribute key naming conventions. However, in this case, OTel diverges from the strict naming rules, in favour of leaving header names in a well-known form.This PR removes the dash -> underscore conversion, while leaving the lower-casing as-is.
Example:
Previously:
http.request.header.user_agentNow:
http.request.header.user-agentImportantly, keys with an underscore in the original header are left as-is.
closes https://linear.app/getsentry/issue/ENG-8467/sdks-need-to-send-the-correct-header-httprequestheaderuser-agent