Skip to content

Commit

Permalink
fix(aws-sdk): sns span name should be with low cardinality (#841)
Browse files Browse the repository at this point in the history
* fix(aws-sdk): sns span name should be with low cardinality

* fix(aws-sdk): update test

* fix(aws-sdk): fix lint

Co-authored-by: Rauno Viskus <[email protected]>
  • Loading branch information
Yaniv Davidi and rauno56 authored Jan 21, 2022
1 parent 2e14f46 commit 7032a33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 7032a33

Please sign in to comment.