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: link net and http instrumentations correctly #2046

Merged
merged 12 commits into from
Mar 29, 2021

Conversation

seemk
Copy link
Contributor

@seemk seemk commented Mar 25, 2021

Which problem is this PR solving?

http instrumentation did not activate the context of the outgoing request span before doing the request, thus net instrumentation received the wrong active context.

Context in the callbacks / event emitters is unchanged, i.e. it is the parent context.

Short description of the changes

Examples show an express app receiving an http request which invokes an outbound http request.

Before

image

After

image

@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #2046 (c73acbd) into main (ed92829) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2046      +/-   ##
==========================================
+ Coverage   92.99%   93.01%   +0.02%     
==========================================
  Files         152      152              
  Lines        5938     5944       +6     
  Branches     1236     1237       +1     
==========================================
+ Hits         5522     5529       +7     
+ Misses        416      415       -1     
Impacted Files Coverage Δ
...ges/opentelemetry-instrumentation-http/src/http.ts 95.61% <100.00%> (+0.10%) ⬆️
...emetry-core/src/platform/node/RandomIdGenerator.ts 93.75% <0.00%> (+6.25%) ⬆️

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.

lgtm

Copy link
Member

@johnbley johnbley left a comment

Choose a reason for hiding this comment

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

Thanks for this; looks like a clean fix to the issue.

@vmarchaud vmarchaud merged commit a707588 into open-telemetry:main Mar 29, 2021
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.

4 participants