(AWS SDK for Java) Automatically disable segments in SDK background processes
- Dominant language
- Java
- Stars
- 100
- Forks
- 100
- PR merge metrics
- No merged PRs in 30d
Description
On the AWS SDK for Java 2.x, we sometimes make calls to AWS services as async background tasks, for example to cloudwatch to upload SDK metrics or to STS to refresh assumed-role credentials.
Customers that are using the automatic SDK instrumentation for x-ray are getting failures or warnings about a segment not being started in these background tasks because the SDK isn't starting a segment, and the customer doesn't control these service calls.
The AWS SDK for Java doesn't compile against the x-ray SDK, so we can't start a segment on behalf of the customer, but could we provide a "background task" flag to the x-ray execution interceptor to let it know that a segment isn't required because it isn't related to an ongoing trace?
I could even provide a pull request for this, as it should be relatively simple to implement on both sides myself.
Additional context from an affected user: https://github.com/aws/aws-sdk-java-v2/issues/2919
Contributor guide
Research direction
Start by reading the X-Ray execution interceptor and the affected-user context in issue 2919, then trace how SDK background calls to CloudWatch and STS reach it. Done means background tasks no longer produce missing-segment failures or warnings, while calls belonging to an ongoing trace retain their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100