Skip to content

Conversation

yiyuan-he
Copy link
Contributor

@yiyuan-he yiyuan-he commented Sep 25, 2024

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.

Test Plan:

Set up a client-server with auto-instrumentation to verify that the correct span data is being generated.

sns_topic_arn_span_data_verification
secretsmanager_secret_arn_span_data_verification
sfn_statemachine_arn_span_data_verification
sfn_activity_arn_span_data_verification
lambda_function_name_span_data_verification
lambda_event_source_mapping_uuid_span_data_verification

Unit Tests for Instrumentation Patches and AWS Metric Attribute Generators.

instrumentation_patch_unit_test_verification
aws_metric_attribute_generator_unit_test_verification

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 yiyuan-he requested a review from a team as a code owner September 25, 2024 23:38
@yiyuan-he yiyuan-he requested a review from mxiamxia September 25, 2024 23:39
@yiyuan-he
Copy link
Contributor Author

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.

@yiyuan-he yiyuan-he closed this Sep 26, 2024
@yiyuan-he yiyuan-he reopened this Sep 26, 2024
@yiyuan-he yiyuan-he merged commit 831b76b into aws-observability:main Sep 30, 2024
12 checks passed
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:

![image](https://github.com/user-attachments/assets/7f1cfcec-8827-4dc7-beaf-2a1b9b98e4f4)

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants