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.
What Does This Do
This PR removes the underlying HTTP client spans beneath AWS-SDK calls. The HTTP client span is an implementation detail of the AWS-SDK call, rather than a request to a different service, and collapsing the trace to just show the AWS-SDK calls makes distributed traces easier to follow.
Users who require the old behaviour can re-enable it with this system property:
or by setting this environment variable:
Motivation
We want to make SQS receive spans more consistent with other messaging integrations. This will involve excluding certain SQS calls from our AWS-SDK instrumentation and adding new SQS specific instrumentation. The new SQS instrumentation will avoid creating spans when no messages are received, but underneath the AWS-SDK is still making an HTTP call to check for new messages. Since we don't know at the time of the underlying HTTP call whether we will actually get any messages we cannot filter out any HTTP span at that point. It is also hard to tell which AWS service is being called without examining the attached entity since AWS-SDK uses POST by default.
The simplest solution was to remove the underlying HTTP client spans beneath AWS-SDK calls.
Before:
After:
Additional Notes
This PR also moves setting of the X-Ray propagation header out from the different low-level HTTP instrumentations and into the AWS-SDK instrumentations where it really belongs. (To avoid adding an extra helper class the propagation setter interface was implemented by the existing AWS-SDK decorators.)