-
Notifications
You must be signed in to change notification settings - Fork 584
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
base: main
Are you sure you want to change the base?
Conversation
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.
); | ||
}); | ||
|
||
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
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 89.69% 89.78% +0.09%
==========================================
Files 186 187 +1
Lines 9041 9155 +114
Branches 1855 1886 +31
==========================================
+ Hits 8109 8220 +111
- Misses 932 935 +3
🚀 New features to boost your workflow:
|
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 :)
@@ -158,3 +158,6 @@ export const GEN_AI_TOKEN_TYPE_VALUE_INPUT = 'input' as const; | |||
* Enum value "output" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}. | |||
*/ | |||
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.
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
@@ -158,3 +158,6 @@ export const GEN_AI_TOKEN_TYPE_VALUE_INPUT = 'input' as const; | |||
* Enum value "output" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}. | |||
*/ | |||
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.