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): add http.host attribute before sending the request #3054

Conversation

cuichenli
Copy link
Contributor

Which problem is this PR solving?

Instead of add the http.host attribute after received the response, this PR changed it to add the attribute before the request was sent.

Fixes #3031

Short description of the changes

Infer the hostname and port from the host field

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit test

Signed-off-by: Cuichen Li <cuichli@cisco.com>
Signed-off-by: Cuichen Li <cuichli@cisco.com>
Signed-off-by: Cuichen Li <cuichli@cisco.com>
@cuichenli cuichenli requested a review from a team June 22, 2022 04:00
@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #3054 (a79e9f4) into main (e76cb8b) will increase coverage by 0.01%.
The diff coverage is 100.00%.

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

@@            Coverage Diff             @@
##             main    #3054      +/-   ##
==========================================
+ Coverage   92.69%   92.70%   +0.01%     
==========================================
  Files         181      181              
  Lines        5655     5664       +9     
  Branches     1201     1202       +1     
==========================================
+ Hits         5242     5251       +9     
  Misses        413      413              
Impacted Files Coverage Δ
...ges/opentelemetry-instrumentation-http/src/http.ts 94.42% <100.00%> (-0.04%) ⬇️
...es/opentelemetry-instrumentation-http/src/utils.ts 99.06% <100.00%> (+0.05%) ⬆️

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you rebase your PR ? otherwise the small nit, lgtm

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The attribute changes LGTM. However, I find that the new changes on the timeout event are not convincing. Would you mind splitting that into another PR?

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

experimental/CHANGELOG.md Show resolved Hide resolved
experimental/CHANGELOG.md Show resolved Hide resolved
@vmarchaud vmarchaud merged commit b1c0062 into open-telemetry:main Jul 30, 2022
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.

[instrumentation http]: Missing http.host attribute on timed out requests
5 participants