-
-
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
Capture transaction name for errors (v8) #10846
Comments
I agree with the proposed solution. Undeprecating is probably the right way to go. I don't have a better name for it and assuming we move further away from the transaction event in the coming months, the ambiguity between One thought:
To slightly decouple calling Regardless, automatically updating the transaction on the scope is already step 2 for this issue so we can still discuss this. |
RE automatically updating the |
UPDATE: For now, we'll disregard the concern outlined in this answer but I'm leaving it here b/c it explains the precedence dilemma well and it's important to be aware of the concern. We can always revisit the behaviour. After a shower thought, I'm not entirely sure anymore if decoupling I think we need to look at four cases to properly assign
Obviously, 4 could go both ways and there are pros/cons to both of them:
technical note: If we go with 4 taking event.transaction = scope.transactionName ? scope.transactionName : rootSpan?.name || undefined otherwise, it boils down to event.transaction = rootSpan?.name ? rootSpan?.name : scope.transactionName || undefined |
Events should still/anyhow be linked to transactions through the trace though, shouldn't they? This is just about what the I'm also OK with making the root span name take precedence over the scope transactionName, but keep in mind that this will also lead to inconsistent transaction names (possibly) on the same event because the root span will sometimes exist, sometimes not, so you'll get different |
I think so, yes. Actually I strongly hope so 😅 I'll test things a bit more to be sure but yeah, I'll just continue with the initial plan. We can always revisit... |
Added a quite elaborate answer about our plan and the precedence dilemma here: #11025 (comment) |
Super small PR to check that an error event has a valid `transaction` field in NextJS. Besides testing, there was nothing specifically to do for NextJS since as far as I can tell we never update a pageload or navigation span name. ref #10846
…entry#11424) Super small PR to check that an error event has a valid `transaction` field in NextJS. Besides testing, there was nothing specifically to do for NextJS since as far as I can tell we never update a pageload or navigation span name. ref getsentry#10846
…etsentry#11510) This PR adds scope transactionName updating to our NestJS instrumentation. Similarly to Hapi and Fastify, we can use a framework-native component, an Interceptor, to assign the parameterized route. ref getsentry#10846
We have a
transaction
field on events (e.g. error events) which is used in-product for a bunch of things.We need a way to also ensure this works in v8. We've deprecated
scope.setTransactionName()
but maybe need to revisit this.Status Quo
In the JS SDK, we currently only set
event.transaction
in the request data integration - so only in server environments.In Browser SDKs, we never set this today - we only set a
transaction
tag.Some constraints:
Solution
Update: After an internal meeting, we settled on the following solution:
We un-deprecate
scope.setTransactionName()
, which can be used with or without performance.In our own auto-instrumentation, we can use that to automatically set the transaction name on the scope. This can happen based on spans, or not.
Users can always overwrite it on the given scope.
Important: The scope's transaction name will no longer be coupled to root spans or spans in general. Meaning, it's purpose is to associate errors and other events with location (i.e. a transaction) and not 1:1 with a root span name. In many cases, when we auto instrument things, the names will be the same but there can be cases when these two diverge.
Examples:
http.server
middlewaresPossibly we can also generally set it whenever a root span is started viastartSpan
APIs (=a span without a parent)Undeprecation and Decoupling
scope.transactionName
from root spans #10991requestDataIntegration
#11513Auto-Updating Scope
transactionName
(browser)scope.transactionName
on pageload and navigation span creation #10992transactionName
when route is resolved #11043transactionName
in React Router instrumentations #11048transactionName
when pageload route name is updated #11406transactionName
when resolving route #11420transactionName
when resolving a route #11423transaction
field #11424Auto-Updating Scope transactionName (server)
transactionName
in http and express instrumentations #11434transactionName
when handling request #11447transactionName
when handling request #11448transactionName
when creating router span #11476transactionName
for Remix server features #11784transactionName
to isolation scope for Next.js server side features #11782transactionName
to isolation scope for requests #11786Some caveats:
NonRecordingSpans
which have no name. So we can't read it off the active span (which additionally also has the downside that we can't read it once the active span is over, e.g. browser tracing).The text was updated successfully, but these errors were encountered: