Closed
Description
We've identified this API, or rather its implementation as problematic.
Scope.setTransactionName()
will populate the transaction
field of any event that comes after that call on that scope (and any scopes that were cloned from that scope).
The transaction
field is used for associating an error with a transaction (not an actual transaction event in Sentry but rather a route or error origin) when dealing with an error event, and it contains the name of a transaction when dealing with a transaction event.
While this sounds nice and all, overwriting the name of transactions like this is a bit problematic:
- It's a bit opaque that this is the behaviour of
Scope.setTransactionName()
- Often times we already have a high-quality transaction name through auto-instrumentation (
source: route
) and we don't want to have it overridden by the user. While we should provide users to overwrite high quality transaction names if they really want to, they probably shouldn't do it withScope.setTransactionName()
. It's very likely that this function just causes side-effects that the user didn't intend to introduce. - If
transaction
is overriden byScope.setTransactionName()
we're not updating thesource
of the transaction tocustom
. We needsource
to be correct for Dynamic Sampling.
Metadata
Metadata
Assignees
Labels
No labels