Skip to content
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

Flexible header matching for HTTP propagator #2504

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Dec 22, 2022

While working with OpenTelemetry, I noticed their propagator is flexible when working with Rack HTTP headers.

Our HTTP propagator has always only matched headers that are formatted as HTTP_MY_HEADER_NAME. This means it was not possible to perform simple matches, like my-header-name.

Because it's possible to do both at the same time with almost guarantee safety, this PR does that.

The only conflicting case is if both my-header-name and HTTP_MY_HEADER_NAME are present in the environment. In such case, we prefer to perform the exact match: my-header-name.

I believe this will have no effect on current users.

@marcotc marcotc requested a review from a team December 22, 2022 00:44
@marcotc marcotc self-assigned this Dec 22, 2022
@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Dec 22, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #2504 (c1470eb) into master (89d7ebf) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2504      +/-   ##
==========================================
- Coverage   98.32%   98.32%   -0.01%     
==========================================
  Files        1124     1124              
  Lines       60629    60637       +8     
==========================================
+ Hits        59614    59621       +7     
- Misses       1015     1016       +1     
Impacted Files Coverage Δ
...atadog/tracing/contrib/http/distributed/fetcher.rb 100.00% <100.00%> (ø)
...g/tracing/contrib/http/distributed/fetcher_spec.rb 100.00% <100.00%> (ø)
lib/datadog/core/diagnostics/environment_logger.rb 98.42% <0.00%> (-1.58%) ⬇️
spec/datadog/profiling/native_extension_spec.rb 98.74% <0.00%> (+0.62%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@marcotc marcotc merged commit f18db7a into master Dec 22, 2022
@marcotc marcotc deleted the flexible-http-propagator branch December 22, 2022 19:04
@github-actions github-actions bot added this to the 1.9.0 milestone Dec 22, 2022
@TonyCTHsu TonyCTHsu mentioned this pull request Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants