Closed kudlav closed 1 year ago
Hi, you gotta set the span you want operations to be attached to on the scope. You can read up on it here: https://docs.sentry.io/platforms/javascript/performance/instrumentation/custom-instrumentation/
Relevant line:
Sentry.getCurrentHub().configureScope(scope => scope.setSpan(transaction));
Sorry, I forgot to attach also root Sentry.startTransaction and Sentry.configureScope. I've added those into SDK Setup section. Looks pretty similar so I don't think the problem is in this line.
In your case you want to set workSpan
on the scope. Are you doing that?
Solved by calling Scope.setSpan(childSpan)
after creating nested child span and calling Sentry.getCurrentHub().popScope();
after finishing nested span. The pop function was the key.
const childSpan = span.startChild({ op });
Sentry.getCurrentHub().getScope()?.setSpan(childSpan);
// doSomething
childSpan.finish();
Sentry.getCurrentHub().popScope();
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/node
SDK Version
7.36.0
Framework Version
16.19.0
Link to Sentry event
https://sentry.io/maptiler/performance/tileserver:a065ccba6659425cbc28c4b93238659b
SDK Setup
Steps to Reproduce
similar to: https://github.com/getsentry/sentry-dotnet/issues/2023
Expected Result
Event Details:
Actual Result
Event Details: