-
Notifications
You must be signed in to change notification settings - Fork 398
swap out the existing headers normalization logic with the tag normalizer #5041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: add-process-tags-to-tracing
Are you sure you want to change the base?
swap out the existing headers normalization logic with the tag normalizer #5041
Conversation
…izer used for spans
|
👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description. If changes need to be present in CHANGELOG.md you can state it this way **Change log entry**
Yes. A brief summary to be placed into the CHANGELOG.md(possible answers Yes/Yep/Yeah) Or you can opt out like that **Change log entry**
None.(possible answers No/Nope/None) Visited at: 2025-11-12 16:20:11 UTC |
| it 'preserves them' do | ||
| is_expected.to eq(tag) | ||
| is_expected.to eq("") | ||
| end | ||
| end | ||
|
|
||
| context 'with unsupported characters' do | ||
| let(:tag) { "\\ \t!@?" } | ||
|
|
||
| it 'replaces each with an underscore' do | ||
| is_expected.to eq('_' * tag.size) | ||
| # turns into an empty string because in a tag, the first character must be a letter | ||
| is_expected.to eq('') | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When changing the logic -- please update the test description as well! It'd be quite confusing to have a test saying "it replaces each with an underscore" that actually is not true :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! good catch, I'll use a better description for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the description but open to feedback on the wording !
What does this PR do?
Uses the new tag normalization logic that was copied from the Trace Agent for headers.
Motivation:
While working on #5033, it was noticed that the current normalization logic in dd-trace-rb is missing some of the logic from https://github.com/DataDog/datadog-agent/blob/45799c842bbd216bcda208737f9f11cade6fdd95/pkg/trace/traceutil/normalize.go#L131 , specifically around:
_are mergedChange log entry
feat: swap out the existing headers normalization logic with the tag normalizer
Additional Notes:
I am not sure if we consider this to be a bug or a missing feature, but note that with this new logic, some of the headers results are going to be empty strings ie:
"", which can be seen in the tests below.How to test the change?
I've been using: