-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat: start a root span with spanOptions.parent = null #889
feat: start a root span with spanOptions.parent = null #889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The extractedSpanContext is kept on context in this case and may jump in later, Is this expected or should we somehow remove it there? |
If I create a root span A, then a second root span B, if I create a span C without first setting B as the active span or specifying the C parentage in span options, I think it is reasonable to assume that span A would become its parent. Same holds true if A is not an active span but is just the extracted span context. In other words, I think this is ok for now. If users want to clear context for some advanced use-case, there exist methods to do that. In the most common case, the span you want to be the parent will be set as the active span anyways. |
Codecov Report
@@ Coverage Diff @@
## master #889 +/- ##
===========================================
- Coverage 94.00% 66.36% -27.64%
===========================================
Files 247 81 -166
Lines 10717 1995 -8722
Branches 1040 296 -744
===========================================
- Hits 10074 1324 -8750
- Misses 643 671 +28
|
@open-telemetry/javascript-approvers we need more reviews on this, please take a look when you get a minute. |
…y#889) * feat: start a root span with spanOptions.parent = null * chore: lint * chore: add return type for readability
Fixes #886