-
Notifications
You must be signed in to change notification settings - Fork 404
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: Added entity linking attributes to aws-sdk v3 Lambda segments #2845
feat: Added entity linking attributes to aws-sdk v3 Lambda segments #2845
Conversation
Signed-off-by: mrickard <[email protected]>
Signed-off-by: mrickard <[email protected]>
…f account ID is undefined Signed-off-by: mrickard <[email protected]>
…egments recorded within a serverless context, as they're not required for linking the Lambda entity Signed-off-by: mrickard <[email protected]>
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.
Code looks fine. Just some comments on the jsdoc
…ower case Signed-off-by: mrickard <[email protected]>
Signed-off-by: mrickard <[email protected]>
Signed-off-by: mrickard <[email protected]>
…ambda linking tests Signed-off-by: mrickard <[email protected]>
…e to differences in local and remote behavior Signed-off-by: mrickard <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2845 +/- ##
==========================================
- Coverage 97.26% 97.20% -0.06%
==========================================
Files 294 295 +1
Lines 46405 46462 +57
==========================================
+ Hits 45135 45164 +29
- Misses 1270 1298 +28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Description
External Lambda functions invoked by a Node application result in external segments. In order for the entity to be linked, external segments need two additional attributes:
cloud.resource_id
andcloud.platform
. This PR adds middleware atinstrumentation/aws-sdk/v3/lambda.js
(viainstrumentation/aws-sdk/v3/smithy-client.js
) to add these attributes. This middleware adds the attributes only if the agent's config includes an AWS account ID defined ascloud.aws.account_id
. The account ID referenced here should be the same as the AWS account ID hosting Lambda functions that will be invoked by the instrumented Node application.How to Test
There are two new tests in
test/versioned/aws-sdk-v3/lambda.test.js
: one to test for these new attributes whencloud.aws.account_id
is set on the agent config, and one to test for their absence whencloud.aws.account_id
is not set.Related Issues
Closes #2829
Closes NR-348168