-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(core): Deprecate Span.transaction
in favor of getRootSpan
#10134
Conversation
size-limit report 📦
|
Span.tranasction
in favor of getRootSpan
Span.transaction
in favor of getRootSpan
@@ -66,6 +66,8 @@ export class Transaction extends SpanClass implements TransactionInterface { | |||
this._trimEnd = transactionContext.trimEnd; | |||
|
|||
// this is because transactions are also spans, and spans have a transaction pointer | |||
// TODO (v8): Replace this with another way to set the root span |
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.
Is there even a todo for v8 here? Won't we get rid of the transaction class?
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.
Hmm I mean we somehow still need to construct a transaction for the event payload so I guess it's not gonna vanish completely. We'll just need some way to set and find the root span/txn of a span in v8.
4ffb363
to
f6ce2a9
Compare
f6ce2a9
to
c2c20b1
Compare
This PR deprecates the
transaction
field on theSpan
interface and class. Instead, we'll store the span hierarchy in a different format external to the span class. In node-experimental, we use a WeakMap referencing the parent span as a data structure which we might need to generally do in v8. This, however, is a breaking change, so for now we deprecate the field but use it in the replacement utility function for v7.Replacing most reads of
span.transaction
was fairly easy - only setting the root span is still done on the deprecated field.