-
Notifications
You must be signed in to change notification settings - Fork 969
feat: Add AWS_SNS_TOPIC_ARN semantic convention support for AWS SNS SDK #14035
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
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.
Do I understand correctly that usually aws.sns.topic.arn
contains the same value as messaging.destination.name
? @trask is there any guidance on having multiple attributes with the same value?
MESSAGING_DESTINATION_NAME does not cover APIs like 'CreateTopic' which sets TopicArn on Response instead of Request. AWS_SNS_TOPIC_ARN is the generic semconv attribute for SNS Apis. |
282e855
to
39fee7a
Compare
it seems ok based on this semconv tends to avoid conditionally setting the second one only when it's different |
c.publish( | ||
new PublishRequest().withMessage("somemessage").withTargetArn("somearn")))); | ||
@Test | ||
public void testCreateTopicRequestWithMockedResponse() throws Exception { |
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.
usually we add tests as package private methods
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.
access modifier removed. I think the default is package-private.
@@ -32,47 +50,66 @@ protected boolean hasRequestId() { | |||
return true; | |||
} | |||
|
|||
@ParameterizedTest | |||
@MethodSource("provideArguments") | |||
public void testSendRequestWithMockedResponse(Function<AmazonSNS, Object> call) throws Exception { |
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.
as far as I can tell you could have kept the original parameterized tests and just added the additionalAttributes
as another parameter
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.
Good feedback. Thank you @laurit.
This PR adds the AWS_SNS_TOPIC_ARN semantic convention attribute for the following AWS resources: AWS SNS SDK v1 AWS SNS SDK v2 The topic ARN is extracted from both request and response objects, and this behavior is covered by unit tests. Tests Run: ./gradlew spotlessCheck ./gradlew instrumentation:check ./gradlew :smoke-tests: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 v1
AWS SNS SDK v2
The topic ARN is extracted from both request and response objects, and this behavior is covered by unit tests.
Tests Run:
./gradlew spotlessCheck
./gradlew instrumentation:check
./gradlew :smoke-tests: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.