-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
POTEL 30 - span.startChild
now uses .makeCurrent()
by default
#3544
POTEL 30 - span.startChild
now uses .makeCurrent()
by default
#3544
Conversation
|
Performance metrics 🚀
|
@@ -129,7 +129,11 @@ public OtelSpanWrapper( | |||
return NoOpSpan.getInstance(); |
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.
this should also use makeCurrent(), even if there is no practical change, right?
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.
Yeah NoOpSpan.makeCurrent
does nothing and returns a NoOpScopesLifecycleToken
atm.
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.
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
.
📜 Description
When starting a child span of a
OtelSpanWrapper
span (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
SpanOptions
that allows customers to control this. We already havebindToScope
forTransactionOptions
which defaults tofalse
. For backend IMO it makes much more sense to bind to scope by default. This option can then also be used forSentry.startSpan
andSentry.startInactiveSpan
.💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps