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
9.38.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
Steps to Reproduce
Invoke Lambda function n times while it is still warm
Edit: After some more investigation I found out that this does not happen when disabling the OTel AwsLambdaInstrumentation. However, it also does not happen when running the OTel instrumention standalone without Sentry, so the issue seems to be constrained to the combination of Sentry SDK + Otel AwsLambdaInstrumentation
Expected Result
Have n traces show up in Sentry
Actual Result
n-1 traces, last one missing
following errors from @opentelemetry/instrumentation-aws-lambda in the Lambda logs:
Sentry Logger [error]: Spans may not be exported for the lambda function because we are not force flushing before callback
Sentry Logger [error]: Metrics may not be exported for the lambda function because we are not force flushing before callback
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
9.38.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
SENTRY_TRACES_SAMPLE_RATE=1.0Steps to Reproduce
Invoke Lambda function n times while it is still warm
Edit: After some more investigation I found out that this does not happen when disabling the OTel AwsLambdaInstrumentation. However, it also does not happen when running the OTel instrumention standalone without Sentry, so the issue seems to be constrained to the combination of Sentry SDK + Otel AwsLambdaInstrumentation
Expected Result
Have n traces show up in Sentry
Actual Result
n-1 traces, last one missing
following errors from
@opentelemetry/instrumentation-aws-lambdain the Lambda logs:Sentry Logger [error]: Spans may not be exported for the lambda function because we are not force flushing before callbackSentry Logger [error]: Metrics may not be exported for the lambda function because we are not force flushing before callback