diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts index d8bd60271c..9652719e83 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts @@ -44,7 +44,9 @@ export class SnsServiceExtension implements ServiceExtension { this.extractDestinationName(TopicArn, TargetArn, PhoneNumber); spanName = `${ - spanAttributes[SemanticAttributes.MESSAGING_DESTINATION] + PhoneNumber + ? 'phone_number' + : spanAttributes[SemanticAttributes.MESSAGING_DESTINATION] } send`; } diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts index 93fb0a09e3..2c2be487f7 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts @@ -101,7 +101,7 @@ describe('SNS', () => { .promise(); const publishSpans = getTestSpans().filter( - (s: ReadableSpan) => s.name === `${PhoneNumber} send` + (s: ReadableSpan) => s.name === 'phone_number send' ); expect(publishSpans.length).toBe(1); const publishSpan = publishSpans[0];