-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Add auto-instrumentation support for in AWS V2 SDK for SNS, Sec… #12
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…retsManager, StepFunctions, and Lambda
yiyuan-he
commented
Oct 2, 2024
...g/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy
Show resolved
Hide resolved
mxiamxia
approved these changes
Oct 3, 2024
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! The workflow checks are not stable, will merge if rerun works
mxiamxia
pushed a commit
to aws-observability/aws-otel-java-instrumentation
that referenced
this pull request
Oct 9, 2024
#899) ### *Description of changes:* Changes in ADOT package to support new AWS resources in Java V1 & V2 SDKs. Related changes for V1 SDK in upstream package: mxiamxia/opentelemetry-java-instrumentation#11 Related changes for V2 SDK in upstream package: mxiamxia/opentelemetry-java-instrumentation#12 These changes add auto-instrumentation support for the following AWS resources. Additionally, a new attribute for `aws.remote.resource.cfn.primary.identifier` is also added for each new resource. - Populate `aws.sns.topic.arn` in Span by extracting `TopicArn` from the request body. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html - The CFN Id should be the ARN of the Topic. - Populate `aws.secretsmanager.secret.arn` in Span by extracting `ARN` from response body. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secret.html - The CFN Id should be the ARN of the Secret. - Populate `aws.stepfunctions.state_machine.arn` in Span by extracting `stateMachineArn` from the request body. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html - The CFN Id should be the ARN of the State Machine. - Populate `aws.stepfunctions.activity.arn` in Span by extracting `activityArn` from the request body. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-activity.html - The CFN Id should be the ARN of the Activity. - Populate `aws.lambda.function.name` in Span by extracting `FunctionName` from the request body. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html - The CFN Id should be the ARN of the Lambda Function. - Populate `aws.lambda.resource_mapping.id` in Span by extracting `UUID` from the request body. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html - The CFN Id should be the UUID of the Event Source Mapping. ### *Test Plan:* Set up a client-server with auto-instrumentation to verify that the correct span data is being generated. Note: V1 span data is top pic and V2 span data is bottom pic for each resource. `aws.lambda.function.name` <img width="1512" alt="lambda-function-name-span-data-verification-v1" src="https://github.com/user-attachments/assets/ecc6780e-546b-4776-a916-16cac97863ec"> <img width="1512" alt="lambda-function-name-span-data-verification-v2" src="https://github.com/user-attachments/assets/eb4d288d-dbb4-4dd1-9562-abea8ec91937"> `aws.lambda.resource_mapping.id` <img width="1512" alt="lambda-resource-mapping-id-span-data-verification-v1" src="https://github.com/user-attachments/assets/5059000a-ef5a-4eec-a0d8-e2e63c144ff3"> <img width="1512" alt="lambda-resource-mapping-id-span-data-verification-v2" src="https://github.com/user-attachments/assets/54fea71d-05bc-40ac-98b8-5e4d49b0d391"> `aws.secretsmanager.secret.arn` <img width="1512" alt="secretsmanager-secret-arn-span-data-verification-v1" src="https://github.com/user-attachments/assets/e0cf9fcb-1d99-4ed9-bf33-f9e04c4ad352"> <img width="1512" alt="secretsmanager-secret-arn-span-data-verification-v2" src="https://github.com/user-attachments/assets/2db81495-d8a7-43cf-a616-4cbe6bd3d3f8"> `aws.sns.topic.arn` <img width="1512" alt="sns-topic-arn-span-data-verification-v1" src="https://github.com/user-attachments/assets/cc000f1f-ded7-4d02-98e6-545583f47e5e"> <img width="1512" alt="sns-topic-arn-span-data-verification-v2" src="https://github.com/user-attachments/assets/666fcfd2-045a-4a0a-a5c2-662bcaa60e41"> `aws.stepfunctions.activity.arn` <img width="1512" alt="stepfunctions-activity-arn-span-data-verification-v1" src="https://github.com/user-attachments/assets/e3ade244-eb1e-4f5c-9878-5c78ee4f2a32"> <img width="1512" alt="sfn-activity-arn-span-data-verification-v2" src="https://github.com/user-attachments/assets/89814a71-bbac-4026-b4e1-591f767e3a13"> `aws.stepfunction.state_machine.arn` <img width="1512" alt="stepfunctions-state-machine-arn-span-data-verification-v1" src="https://github.com/user-attachments/assets/91670d86-a726-472a-8f0f-b156cd68ef63"> <img width="1512" alt="sfn-state-machine-arn-span-data-verification-v2" src="https://github.com/user-attachments/assets/70f59b80-af4c-400d-84e5-35fd06eef20e"> Metric Attribute Generator Unit Test <img width="1512" alt="Screenshot 2024-10-02 at 2 59 35 PM" src="https://github.com/user-attachments/assets/fadf5ec5-dba3-46a4-abdd-d8cd9ab56cc5"> By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes:
Changes in upstream package to support new AWS resources in Java V2 SDK.
Mostly duplicating implementation changes from this PR since they are not merged yet and I had to test locally: #10
These changes add auto-instrumentation support for the following AWS resources. Additionally, a new attribute for
aws.remote.resource.cfn.primary.identifier
is also added for each new resource.aws.sns.topic.arn
in Span by extractingTopicArn
from the request body.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html
aws.secretsmanager.secret.arn
in Span by extractingARN
from response body.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secret.html
aws.stepfunctions.state_machine.arn
in Span by extractingstateMachineArn
from the request body.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html
aws.stepfunctions.activity.arn
in Span by extractingactivityArn
from the request body.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-activity.html
aws.lambda.function.name
in Span by extractingFunctionName
from the request body.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html
aws.lambda.resource_mapping.id
in Span by extractingUUID
from the request body.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html
Test Plan:
Set up a client-server with auto-instrumentation to verify that the correct span data is being generated.
aws.lambda.function.name
aws.lambda.resource_mapping.id
aws.secretsmanager.secret.arn
aws.sns.topic.arn
aws.stepfunctions.activity.arn
aws.stepfunction.state_machine.arn
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.