SQS: adds attributes to spans that allow linking to SQS entities #1954
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.
Overview
Adds the following attributes to SQS external spans so they can be linked to the respective SQS entity.
messaging.system
cloud.region
cloud.account.id
messaging.destination.name
Related Github Issue
#1835
Testing
Testing for this feature is a hampered due to a dependency. When that dependency is updated, then the tests in the SQS instrumentation modules can be run.
API changes
There are a few changes to the external API. New attributes and methods were added to
MessageProduceParameters
andMessageConsumeParameters
and their respective builders.For the parameters the added methods are getters.
For the builders, new methods were added to the Build interface and all return a Build, so they can be concatenated. The new methods being on the Build interface, essentially make them optional (which they are), thus this addition will not break existing use of the API.
Another method that was added was an overload of the existing
MessageConsumeParameters#library
andMessageProduceParameters#library
methods. This new method receives 2 Strings, the first one is the library name used by the agent, this matches the parameter for the existing method. A second String was added to record the name of the library used by OTEL, which in many cases is slightly different from the agent's. Since this is the first method called in the builder process, this also won't break existing use of the API.Checks