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

fix(instrumentation-http): include query params in http.target #3646

Merged
merged 3 commits into from
Mar 1, 2023

Conversation

kobi-co
Copy link
Contributor

@kobi-co kobi-co commented Mar 1, 2023

Which problem is this PR solving?

According to the spec, http.target attribute should include path + query params, current implementation sets the path without query params.

Attribute Type Description Examples Requirement Level
http.target string The full request target as passed in a HTTP request line or equivalent. /path/12314/?q=ddds Required

Short description of the changes

Fix http.target to use urlObject.path and not urlObject.pathname which is the value the includes the query params.

Type of change

Bug fix

How Has This Been Tested?

Created a new unit test to check http.target attribute value.

@kobi-co kobi-co requested a review from a team as a code owner March 1, 2023 14:24
@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #3646 (89d3aa1) into main (0d373bd) will increase coverage by 0.20%.
The diff coverage is 100.00%.

❗ Current head 89d3aa1 differs from pull request most recent head f7365e2. Consider uploading reports for the commit f7365e2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3646      +/-   ##
==========================================
+ Coverage   93.52%   93.73%   +0.20%     
==========================================
  Files         271      274       +3     
  Lines        7496     8058     +562     
  Branches     1521     1670     +149     
==========================================
+ Hits         7011     7553     +542     
- Misses        485      505      +20     
Impacted Files Coverage Δ
...es/opentelemetry-instrumentation-http/src/utils.ts 99.18% <100.00%> (ø)
...emetry-core/src/platform/node/RandomIdGenerator.ts 87.50% <0.00%> (-6.25%) ⬇️
...y-instrumentation-http/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)
...ges/opentelemetry-instrumentation-http/src/http.ts 94.26% <0.00%> (ø)
...-trace-base/src/platform/node/RandomIdGenerator.ts 93.75% <0.00%> (+6.25%) ⬆️

@dyladan dyladan merged commit a457d94 into open-telemetry:main Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants