From b0fed523a1f594cdc19324b5312db64bab59e77a Mon Sep 17 00:00:00 2001 From: JamieDanielson Date: Tue, 31 May 2022 17:05:52 -0400 Subject: [PATCH] fix(instrumentation-aws-sdk): dedupe prop fields Co-authored-by: Kent Quirk Co-authored-by: Purvi Kanal Co-authored-by: Mike Goldsmith --- .../opentelemetry-instrumentation-aws-sdk/src/services/sqs.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sqs.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sqs.ts index 6d3ca17f76..b67e2cf112 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sqs.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sqs.ts @@ -67,9 +67,7 @@ export class SqsServiceExtension implements ServiceExtension { spanAttributes[SemanticAttributes.MESSAGING_OPERATION] = MessagingOperationValues.RECEIVE; - request.commandInput.MessageAttributeNames = ( - request.commandInput.MessageAttributeNames ?? [] - ).concat(propagation.fields()); + request.commandInput.MessageAttributeNames = Array.from(new Set([ ...(request.commandInput.MessageAttributeNames ?? []), ...propagation.fields()])); } break;