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-net): make tls span parent of net span #1342

Merged
merged 4 commits into from
Jan 15, 2023

Conversation

blumamir
Copy link
Member

@blumamir blumamir commented Jan 3, 2023

Which problem is this PR solving?

  • In @opentelemetry/instrumentation-net, when tls is used, 2 spans are produced: one for tls and one for network. They are currently siblings to each other and the trace structure does not indicate anything about their relationship, even though they relate to the same tls transaction. In the lack of ambient context (HTTP request span / db driver span) they belong to 2 different traces, as the net span starts in an empty ambient context, thus becomes a root span.

Short description of the changes

  • When starting a new tls span, wrap the creation of net span with the tls context so that they are parent-child. Updated the existing tests to assert this behavior

@blumamir blumamir requested a review from a team January 3, 2023 09:42
@blumamir blumamir requested a review from svrnm January 3, 2023 09:48
@codecov
Copy link

codecov bot commented Jan 3, 2023

Codecov Report

Merging #1342 (9721bcd) into main (714e6c1) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1342   +/-   ##
=======================================
  Coverage   96.08%   96.08%           
=======================================
  Files          14       14           
  Lines         893      893           
  Branches      191      191           
=======================================
  Hits          858      858           
  Misses         35       35           

Copy link
Member

@svrnm svrnm left a comment

Choose a reason for hiding this comment

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

besides the comments from @Flarna it looks good to me!

@blumamir blumamir merged commit 1ee197e into open-telemetry:main Jan 15, 2023
@dyladan dyladan mentioned this pull request Jan 15, 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.

3 participants