-
-
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
Sentry.getCurrentScope().setTransactionName(name) not having any effect #14663
Comments
Are you able to reproduce this using the SDK targeted to Sentry SaaS? If on SaaS they don't output the correct result, this issue should be transferred to the JS SDK repository. |
@aldy505 if by Sentry SaaS you just mean the hosted version of Sentry rather than self-hosted, then yes... it appears to be the same regardless of whether my transaction data is sent to my hosted dsn or my self-hosted dsn... I don't see my custom transaction names in either place. |
@bc-sentry @hubertdeng123 Can you guys help transfer this issue over to sentry-javascript? Thanks. |
Hey @drmrbrewer I transferred this issue to the JS SDK repo. Unfortunately, this docs page is very misleading and outdated since v8 of the SDK. To keep it short, You can visit this preview link of the updated page for more information. Feel free to leave feedback on the PR as well if you encounter things that are unclear. EDIT: I (somewhat accidentally) closed this issue. However, I'll keep it closed for now because the docs PR is already up and should get merged soon. Furthermore, the question should be answered. |
Hi @Lms24 thanks, that new page makes it all much clearer. It looks like the most relevant method to me, for my most common usecase which is to set the name dynamically while the request is being processed, will be This is only available from |
Hey @drmrbrewer this is not yet merged unfortunately, so the version in the You can follow the progress of the PR here: #14291 |
@Lms24 looks like this PR is making good progress. When do you think it might end up in a new release? I'm keen to try it out! |
We're probably gonna release today. Your comment gave me some extra motivation to do that :) You can follow the SDK release here: #14777. After the PR is merged it'll be a matter of hours before the SDK packages are released. Once 8.47.0 is released, we can merge the docs PRs that depend on it. |
@Lms24 great, thanks! Appreciate it. |
@Lms24 thanks for pushing this through... seems to work a treat! |
Glad to hear it! Docs should all be up to date as well now :) |
@Lms24 I am using the suggested way of setting the root span name while the span is active:
But I'm also sometimes seeing:
I haven't yet figured out when/why this happens (*), but I had assumed that the suggested method was 'safe' in the sense that it wouldn't throw an exception if maybe (*) maybe it's when the |
@drmrbrewer which SDK are you using? This generally shouldn't happen. Any chance you could find out which span you passed into |
@Lms24 I'm using the node.js SDK. By which span, do you mean the span name I'm trying to set? |
Hmm this is a bit weird because according to our type definitions I'm afraid to debug this properly, we'd need a reproducible example. If you can (and since you said you're still trying to get to the bottom of this, whenever you're ready), it'd be great if you could provide a small sample project (GH repo, Zip, stackblitz whatever). Otherwise, please provide your Sentry setup code, specific SDK version and a small code snippet example how to reproduce the bug. Since I'm ooo for the next days and closed issues don't get tracked, please open a new issue with the information. Sorry for the trouble and thanks for sticking with me! |
Self-Hosted Version
24.9.0
CPU Architecture
arm64
Docker Version
27.3.1, build ce12230
Docker Compose Version
2.29.7
Steps to Reproduce
I have an node.js express route that has two main branches within it, and the chosen branch to go down is based on what is passed into the incoming request. The two branches are quite different and would benefit from being regarded within Sentry as two different transactions.
I have tried calling the following soon after the code branches, to override the transaction name:
Sentry.getCurrentScope().setTransactionName('branchA');
and
Sentry.getCurrentScope().setTransactionName('branchB');
But... I'm not seeing these two transaction names anywhere in my data... in Performance for example I'm just seeing the
GET /myRoute
transaction but not separatebranchA
andbranchB
transactions.What am I doing wrong? So far as I can tell I'm just doing what the docs are telling me to do.
Expected Result
See above.
Actual Result
See above.
Event ID
No response
The text was updated successfully, but these errors were encountered: