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.18.0
Framework Version
No response
Link to Sentry event
https://alku.sentry.io/performance/trace/d7e316d5f796b8b046d0c0cdbf5ca61c/?pageEnd&pageStart&project=4507617300054016&source=traces&statsPeriod=1h×tamp=1722461032.632
Reproduction Example/SDK Setup
Initialization code for both Lambda functions:
Sentry.init({debug: true,dsn: SENTRY_DSN,environment: "sandbox",integrations: [Sentry.postgresIntegration(),nodeProfilingIntegration()],tracesSampleRate: 1.0,profilesSampleRate: 1.0,});Lambda A:
exportconsthandler=Sentry.wrapHandler(async(event)=>{// Generate ClientContext headers// Invoke Lambda B with generated ClientContext// Return a response});Lambda B:
exportconsthandler=async(event,context)=>{const{ baggage, sentryTrace }=extractFromLambdaClientContextHeaders(context);returnawaitSentry.continueTrace({ baggage, sentryTrace },async()=>{console.log(Sentry.getActiveSpan());constqueryString="select count(*) from myTable;";returnawaitSentry.startSpan({name: queryString,op: "db.sql.execute"},async(span)=>{console.log(span);returnawaitexecuteQuery();});});});Steps to Reproduce
- Invoke Lambda A, which invokes Lambda B
- Check Traces, in Sentry.io
Expected Result
The trace should record the "db.sql.execute" span as a child span in the trace.
Actual Result
There is no record of the "db.sql.execute" span at all.
In the logs, I can see that continueTrace creates a nonRecordingSpan, which is not sent to Sentry. I believe this is the root of the problem. The call to startSpan appears to create a normal (recording) span, but since it is a child of the non-recording span, it is not sent along to Sentry either.
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.18.0
Framework Version
No response
Link to Sentry event
https://alku.sentry.io/performance/trace/d7e316d5f796b8b046d0c0cdbf5ca61c/?pageEnd&pageStart&project=4507617300054016&source=traces&statsPeriod=1h×tamp=1722461032.632
Reproduction Example/SDK Setup
Initialization code for both Lambda functions:
Lambda A:
Lambda B:
Steps to Reproduce
Expected Result
The trace should record the "db.sql.execute" span as a child span in the trace.
Actual Result
There is no record of the "db.sql.execute" span at all.
In the logs, I can see that
continueTracecreates anonRecordingSpan, which is not sent to Sentry. I believe this is the root of the problem. The call tostartSpanappears to create a normal (recording) span, but since it is a child of the non-recording span, it is not sent along to Sentry either.