-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(core): Stop clobbering existing transaction name with scope value #5825
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(core): Stop clobbering existing transaction name with scope value #5825
Conversation
size-limit report 📦
|
1e5bbcb
to
9ed4512
Compare
@@ -465,7 +465,7 @@ export class Scope implements ScopeInterface { | |||
event.level = this._level; | |||
} | |||
if (this._transactionName) { | |||
event.transaction = this._transactionName; | |||
event.transaction = event.transaction || this._transactionName; |
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.
Can we add a comment here on why we did this? I.e. a one- or two-liner saying that we don't want to set event.transaction
for transaction events and that it works because transaction events have a transaction
field set from the get-go.
Shouldn't this resolve #5660 (as opposed to resolving only a part of it)? |
My take was that there's still an open question of what |
9ed4512
to
2bb1bcf
Compare
Ah I guess that's also problematic. I originally opened the issue in the context of dynamic sampling where it simply messed up transaction names + source, which is fixed by this PR. So I would just close that issue and open up a new one that basically says " |
I'm fine with that, but I think you could easily get away with not opening a new issue and just commenting on #5718. |
Can we add a test showing we’ll set a transaction name if it’s not defined? |
Pausing on this because I couldn't quite bring myself to write "this makes |
Draft until we figure out if this is actually what we want to do.
This prevents the transaction name stored on the scope from overwriting an event's existing
transaction
value. Since the code in question runs before either event processors orbeforeSend
, the only way for an event to already have atransaction
value at that point area) to be a transaction, or
b) to be a custom event captured by the user.
In the case of a), we don't want to overwrite the existing
transaction
value because we've just done a bunch of work to make sure that it's a good, parameterized value coming in. In the case of b), the user has actively provided a name, which we should respect.Resolves #5660