-
Notifications
You must be signed in to change notification settings - Fork 619
feat: Add AWS_SNS_TOPIC_ARN semantic convention support for AWS SNS SDK #2885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| ); | ||
| }); | ||
|
|
||
| it('topic arn', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| it('topic arn', async () => { | |
| it('should create topic ARN and capture expected trace attributes', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback. Would you please approve the second iteration? @JacksonWeber
JacksonWeber
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2885 +/- ##
=======================================
Coverage 88.99% 89.00%
=======================================
Files 188 188
Lines 9181 9189 +8
Branches 1889 1891 +2
=======================================
+ Hits 8171 8179 +8
Misses 1010 1010
🚀 New features to boost your workflow:
|
david-luna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a small nit :)
| */ | ||
| export const GEN_AI_TOKEN_TYPE_VALUE_OUTPUT = 'output' as const; | ||
|
|
||
| // Copied ATTR_AWS_SNS_TOPIC_ARN from '@opentelemetry/semantic-conventions/incubating' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: copying also the docs would give more info to other contributors if they happen to work with this instrumentation. It also will reflect the experiemental status of the attribute in the IDE
| // Copied ATTR_AWS_SNS_TOPIC_ARN from '@opentelemetry/semantic-conventions/incubating' | |
| /** | |
| * Originally from '@opentelemetry/semantic-conventions/incubating' | |
| * The ARN of the AWS SNS Topic. An Amazon SNS [topic](https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html) is a logical access point that acts as a communication channel. | |
| * | |
| * @example arn:aws:sns:us-east-1:123456789012:mystack-mytopic-NZJ5JSMVGFIE | |
| * | |
| * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | |
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, copying the docs is usually preferred.
JacksonWeber
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thank you for approving this PR @JacksonWeber and @david-luna. May I know why it is not merged into main branch? |
|
@lukeina2z we also need a component owner approval. ref: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/CONTRIBUTING.md#general-merge-requirements |
| const publishSpans = getTestSpans().filter( | ||
| (s: ReadableSpan) => s.name === 'SNS CreateTopic' | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - update name to createTopicSpans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will fail the UT. I believe the span name comes from the auto-instrumentation library. The predicate only reads it, not set it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I meant the variable name publishSpans -> createTopicSpans, I assume the original variable name was from the other test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
| */ | ||
| export const GEN_AI_TOKEN_TYPE_VALUE_OUTPUT = 'output' as const; | ||
|
|
||
| // Copied ATTR_AWS_SNS_TOPIC_ARN from '@opentelemetry/semantic-conventions/incubating' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, copying the docs is usually preferred.
This PR adds the AWS_SNS_TOPIC_ARN semantic convention attribute for the following AWS resources: AWS SNS SDK The topic ARN is extracted from both request and response objects, and this behavior is covered by unit tests. Tests Run: npm run compile npm run lint npm run test All newly added tests pass, and no regressions were found. Backward Compatibility: This change is fully backward compatible. It introduces instrumentation for an additional AWS resource without modifying existing behavior in the auto-instrumentation library.
This PR adds the AWS_SNS_TOPIC_ARN semantic convention attribute for the following AWS resources:
AWS SNS SDK
The topic ARN is extracted from both request and response objects, and this behavior is covered by unit tests.
Tests Run:
npm run compile
npm run lint
npm run test
All newly added tests pass, and no regressions were found.
Backward Compatibility:
This change is fully backward compatible. It introduces instrumentation for an additional AWS resource without modifying existing behavior in the auto-instrumentation library.