-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Support a list of new AWS resources for AWS Python SDK #265
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
Merged
Conversation
This file contains hidden or 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
mxiamxia
reviewed
Sep 26, 2024
aws-opentelemetry-distro/src/amazon/opentelemetry/distro/_aws_metric_attribute_generator.py
Outdated
Show resolved
Hide resolved
Synced offline with @mxiamxia and removed support for Kinesis Consumer Stream. It seems there is still some ambiguity regarding this resource that we need to resolve before we can support it. |
mxiamxia
approved these changes
Sep 27, 2024
mxiamxia
pushed a commit
to aws-observability/aws-otel-js-instrumentation
that referenced
this pull request
Dec 16, 2024
…S SDK (#121) *Description of changes:* Adding support for new AWS resources in JS SDK. Part of an ongoing project to increase the ADOT SDK support in Node and .NET. Changes in this PR support the exact same features as the Python version: aws-observability/aws-otel-python-instrumentation#265 Manual Testing: <img width="1236" alt="Screenshot 2024-11-15 at 1 36 01 PM" src="https://github.com/user-attachments/assets/7480f865-2927-4376-91b5-76048b0bcdf4"> <img width="1234" alt="Screenshot 2024-11-15 at 2 07 05 PM" src="https://github.com/user-attachments/assets/1a5d00b4-9ac8-45e9-b51d-02d7c669f5f1"> <img width="939" alt="Screenshot 2024-11-15 at 2 26 10 PM" src="https://github.com/user-attachments/assets/120892ec-03cf-4b70-80c7-167369cd9e27"> <img width="996" alt="Screenshot 2024-11-18 at 9 47 33 AM" src="https://github.com/user-attachments/assets/08019f4c-507c-46cf-baa0-db77a4175d02"> <img width="934" alt="Screenshot 2024-11-18 at 9 57 22 AM" src="https://github.com/user-attachments/assets/3fb79fa9-689f-4361-b671-79e23c68193d"> <img width="852" alt="Screenshot 2024-11-18 at 10 00 34 AM" src="https://github.com/user-attachments/assets/bde63f88-cdbc-43c9-aa16-068790556ebe"> Unit Tests for Instrumentation Patches and Metric Attribute Generators: <img width="1070" alt="image" src="https://github.com/user-attachments/assets/df01814c-49fb-4561-879b-c88cedb35e5c"> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
yiyuan-he
added a commit
to aws-observability/aws-otel-js-instrumentation
that referenced
this pull request
Feb 5, 2025
**Issue #, if available:** Lambda Topology Issue Context: aws-observability/aws-otel-python-instrumentation#319 **Description of changes:** - Apply fix for the Lambda Topology issue. The logic mimics the fix in our ADOT Python SDK. - Adding back logic to generate `aws.lambda.function.name` and `aws.lambda.function.arn` span attributes for Lambda. Previously, we removed these changes in the AWS Resources expansion due to the Lambda Topology issue. - More context about adding support for Lambda as AWS Resource: - aws-observability/aws-otel-python-instrumentation#265 **Test plan:** The same cases in the test plan of this [PR](aws-observability/aws-otel-python-instrumentation#319) were validated by building a custom JavaScript lambda layer. Below is a screenshot of all the test cases in a single topology. We can observe the following: - Service entity node for `Invoke` call to downstream lambda. - AWS Resource node for `GetFunction` call to downstream lambda. - AWS Resource node for `ListBuckets` call to downstream s3. - Another AWS Resource node for `GetBucketLocation` call to downstream s3. <img width="1359" alt="Screenshot 2025-02-05 at 10 15 26 AM" src="https://github.com/user-attachments/assets/14d38cad-32c7-4e2c-a987-c424c7fb7296" /> Here we see downstream lambda called with `Invoke` is correctly treated as RemoteService entity when not instrumented:  Additionally, I generated the spans locally to validate the new lambda instrumentation patch behaves correctly. **Generated span for `Invoke` call** We see the new `aws.remote.environment` attribute is present in span so the downstream lambda will be treated as a Service type in Application Signals backend. <img width="1124" alt="invoke" src="https://github.com/user-attachments/assets/81cefb44-c951-4ad0-8aeb-9a2064d7d0ea" /> **Generated span for `GetFunction` call** We see `aws.remote.resource.identifier` and `aws.cloudformation.primary.identifier` are set so the downstream lambda will be treated as an AWS resource type in Application Signals backend. <img width="1124" alt="get-function" src="https://github.com/user-attachments/assets/abfd700b-7966-4d93-bb47-868c31be9a34" /> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
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:
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.aws.secretsmanager.secret.arn
in Span by extractingARN
from response body.aws.stepfunctions.state_machine.arn
in Span by extractingstateMachineArn
from the request body.aws.stepfunctions.activity.arn
in Span by extractingactivityArn
from the request body.aws.lambda.function.name
in Span by extractingFunctionName
from the request body.aws.lambda.function.arn
in Span by extractionFunctionArn
from the response body becauseusers are allowed to pass in both the name and ARN in the request body to retrieve the Lambda Function.
aws.lambda.resource_mapping.id
in Span by extractingUUID
from the request body.Test Plan:
Set up a client-server with auto-instrumentation to verify that the correct span data is being generated.
Unit Tests for Instrumentation Patches and AWS Metric Attribute Generators.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.