Skip to content

Transactions aren't capturing async child spans  #3659

@jpike88

Description

@jpike88

Package + Version

  • @sentry/node

Version:

6.5.1

Description

const transaction = Sentry.startTransaction({
					op: encodedApiFunctionToRealName[finalPublicMethodName],
					name: encodedApiFunctionToRealName[finalPublicMethodName],
				});

				try {
					const result = await auth(accessToken);
transaction.finish();
}
})

In the above code, many mysql functions are running, but none of the spans are showing up in the log. I breakpointed inside @sentry/tracing/dist/integrations/mysql.js, and the problem seems to be this code is failing:

const parentSpan = scope?.getSpan();

getSpan() returns undefined.

The transaction logic doesn't seem to be very 'smart', it's not propagating the scope properly via the stack.

This is a big problem for our business, we want to switch to your product from Elastic APM but this makes that untenable.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions