-
Notifications
You must be signed in to change notification settings - Fork 144
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
Linking DynamoDB queries to infra's entities #1868
base: main
Are you sure you want to change the base?
Conversation
Setting cloud.resource_id in DynamoDB instrumentation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1868 +/- ##
=========================================
Coverage 70.68% 70.68%
- Complexity 9877 9893 +16
=========================================
Files 828 829 +1
Lines 39848 39897 +49
Branches 6064 6073 +9
=========================================
+ Hits 28167 28203 +36
- Misses 8954 8962 +8
- Partials 2727 2732 +5 ☔ View full report in Codecov by Sentry. |
} else if (parameters instanceof MessageProduceParameters) { | ||
MessageProduceParameters messageProduceParameters = (MessageProduceParameters) parameters; | ||
setCategory(SpanCategory.generic); | ||
setCloudResourceId(messageProduceParameters.getCloudResourceId()); |
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.
I found a bug where the cloud.resource_id
attribute was never actually getting added to external spans for message producers & consumers when calling cloudResourceId(arn)
on the MessageProduceParameters
/MessageConsumeParameters
builders with a valid ARN. I pushed up a fix and tests for that.
Technically, I think the same problem would exist if reporting an external with a HttpParameters
type. This doesn’t look like it will be a problem for any of our AWS instrumentation as S3 is the only one that reports externals with HttpParameters
and I don’t think we can actually build an ARN for S3 anyways. This might be a problem in the future though with other AWS SDKs or other vendors, so maybe we should also just setCloudResourceId
on HttpParameters
as well?
Move to |
Overview
This PR adds the ability to specify a cloud resource id to some externals.
Having a cloud resource id in a span allows the queried infra entity to be linked to the APM entity.
Note that simply adding the cloud resource id is not enough to make the link. The type of entity must also be supported and instrumented.
To add the cloud resource id, use the new methods
cloudResourceId(String)
available in the builders for DatastoreParameters, MessageConsumeParameters and MessageProduceParameters.This PR also populates this field for DynamoDB externals.
Related Github Issue
Fixes #1802
Testing
Instrumentation tests were already disabled because they were flaky in GHA. Furthermore, while trying to run the tests, an issue was found with some dependencies. So for now the instrumentation tests are on hold.
A new agent integration test was added to test the DynamoDB instrumentation.
Checks