POTEL 30 - span.startChild now uses .makeCurrent() by default#3544
Merged
POTEL 30 - span.startChild now uses .makeCurrent() by default#3544
span.startChild now uses .makeCurrent() by default#3544Conversation
Contributor
|
Contributor
Performance metrics 🚀
|
stefanosiano
reviewed
Jul 3, 2024
| @@ -129,7 +129,11 @@ public OtelSpanWrapper( | |||
| return NoOpSpan.getInstance(); | |||
Contributor
There was a problem hiding this comment.
this should also use makeCurrent(), even if there is no practical change, right?
Member
Author
There was a problem hiding this comment.
Yeah NoOpSpan.makeCurrent does nothing and returns a NoOpScopesLifecycleToken atm.
Member
Author
There was a problem hiding this comment.
I just checked, there's more places where we would have to add this .makeCurrent for noop spans. I'd say we only add it when we actually need it. That's if we ever change NoOpSpan.makeCurrent to modify Context.
stefanosiano
approved these changes
Jul 3, 2024
Base automatically changed from
feat/potel-29-partially-fix-bootstrap-class-loading
to
8.x.x
July 3, 2024 12:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
When starting a child span of a
OtelSpanWrapperspan (i.e. use Sentry API and OpenTelemetry under the hood), we now call.makeCurrent()on the child span by default so it's made the current span.💡 Motivation and Context
Without this, there's a difference in behaviour when using OpenTelemetry. Making a span current was previously part of the transaction which can or cannot be the current transaction on the stack.
We could follow up on this by exposing a flag on
SpanOptionsthat allows customers to control this. We already havebindToScopeforTransactionOptionswhich defaults tofalse. For backend IMO it makes much more sense to bind to scope by default. This option can then also be used forSentry.startSpanandSentry.startInactiveSpan.💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps