Skip to content

Commit 3442633

Browse files
committed
Look at first record eventSource in aws lambda event Records array to determine if it is an sqs event
1 parent 543e484 commit 3442633

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/instrumentation-aws-lambda/src/instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export class AwsLambdaInstrumentation extends InstrumentationBase<AwsLambdaInstr
318318
plugin._applyRequestHook(span, event, context);
319319

320320
return otelContext.with(trace.setSpan(parent, span), () => {
321-
if (event.Records) {
321+
if (event.Records && event.Records[0].eventSource === 'aws:sqs') {
322322
const messages = event.Records;
323323
const queueArn = messages[0]?.eventSourceARN;
324324
const queueName = queueArn?.split(':').pop() ?? 'unknown';

0 commit comments

Comments
 (0)