-
-
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
Child span/transaction name replaced by Lambda function name #13391
Comments
Hey @mstuercke thanks for writing in!
The |
I wanted to write a custom tRPC request handler inside a lambda function and name it like
It does, but it also renames nested transactions Anyway, it would be nice to somehow rename the transaction created by |
Hello, thanks for writing in. We are on company-wide hackweek and thus on limited support this week. We'll take a look at this next week. |
Hello, we are looking into this. |
This appears to be the case even if you use the method of assigning transaction names described in the documentation and do not attempt to create a span. Relevant docs: https://docs.sentry.io/platforms/javascript/guides/aws-lambda/enriching-events/transaction-name/
My transaction name associated with the error is just the lambda name instead of like I'd like. |
Hi, sorry for the silence on this. I haven't had time to look into this yet, but hopefully this week. |
@mstuercke sorry for the late response. Are your lambdas in non-transpiled ESM? The code block you identified only triggers when the lambda handler isn't wrapped by OpenTelemetry. We definitely need to change that so only the root span is named after the function. From my testing, I can name child spans started inside lambdas however I want tho - but I used CJS to test. Going forward, we will probably not add the option to rename the rootspan. You'd have to do that at instantiation of the instrumentation which comes from OpenTelemetry and with some drawbacks. That being said, you should be able to rename these yourself as a user, using our |
Hi @andreiborza , have you had a chance to look into @AlexMayleRdn comment? I am having the same issue. |
@ancheetah the transaction name is set by opentelemetry, we can't change that via |
Thank you for the response!
Yes, it's not transpiled. I'm using Bun and execute
I'm not using OpenTelemetry
I think that I've already tried that and even that didn't work. But I'm not 100% sure and didn't retry it yet. |
@mstuercke right. Yea for the non-opentelemetry case every transaction gets renamed. I'll be working on a fix for that but it might take a while. |
@andreiborza
However, I was able to use beforeSend another way to reach my end goal and filter out events on my dev environment by returning null for a specific tag. Thanks for your help! |
Coming across this issue due to a company-wide triaging initiative:
This API is very unfortunate in the sense that it suggests that it would interfere with the root span (i.e. what the sentry product shows you as a "transaction"). In reality however, it has nothing to do with spans. Even worse, I just noticed that our docs are completely misleading in this, too. I will fix this in docs. As an alternative to this API, you can use
We have a span name inference logic which might be responsible for this. We're working on a solution (#14291) so that a custom-set span name always has precedence over an automatically set name. How to update the (root) span name
|
I opened getsentry/sentry-docs#12091 after which is merged, I think we can close this issue. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/aws-serverless
SDK Version
8.26.0
Framework Version
No response
Link to Sentry event
https://mstuercke.sentry.io/performance/trace/7b533ed86b30290955b43e8b10513c5d/?node=txn-0e0841f1cf3b40a581c8cb50bc1736a9&node=txn-8b8c36aab7304b0e94d50cd767c1a2eb&pageEnd&pageStart&project=4507512062017616&source=traces&statsPeriod=5m×tamp=1723726598.892
Reproduction Example/SDK Setup
Steps to Reproduce
Just execute the code
Additional information:
The renaming happens here:
sentry-javascript/packages/aws-serverless/src/sdk.ts
Lines 219 to 226 in 5c08d03
Expected Result
The span should keep the name
foo-name
Actual Result
The span
name
is replaced with the name of the lambda function. Theop
is untouched.The text was updated successfully, but these errors were encountered: