Skip to content

Conversation

RanVaknin
Copy link
Contributor

@RanVaknin RanVaknin commented Sep 5, 2025

This PR adds:

  1. New utils-lite code package that provides SdkInternalThreadLocal, a wrapper around threadLocal.
  2. Support for trace id propagation using the new utils-lite class

Background

Previously, we implemented trace ID propagation using SLF4J's MDC in PR #6363, but this was
reverted because the MDC interface exists but the implementation is not provided by the SDK, Lambda runtime, or X-Ray SDK.

Solution

Added a small utils-lite utility class that provides thread local key value storage using ThreadLocal<Map<String, String>>. For this case, it allows the Lambda Runtime Interface Client, AWS SDK, and X-Ray SDK to share trace context via this one package, but can extended to other use cases.

Example:

SdkInternalThreadLocal.put("some-value", foo);
String traceId = SdkInternalThreadLocal.get("some-value");
SdkInternalThreadLocal.remove("some-value");
SdkInternalThreadLocal.clear();

@RanVaknin RanVaknin requested a review from a team as a code owner September 5, 2025 17:59
@RanVaknin RanVaknin added the api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team label Sep 5, 2025
@RanVaknin RanVaknin force-pushed the feature/master/utils-lite-lambda-trace branch from 9badcf1 to 85642fe Compare September 11, 2025 17:58
@RanVaknin RanVaknin force-pushed the feature/master/utils-lite-lambda-trace branch from 18ce92a to 8462a02 Compare September 12, 2025 20:01
@RanVaknin RanVaknin force-pushed the feature/master/utils-lite-lambda-trace branch from 90927c1 to 886f7d1 Compare September 15, 2025 19:54
@RanVaknin RanVaknin force-pushed the feature/master/utils-lite-lambda-trace branch from 464b902 to 354048d Compare September 17, 2025 16:44
@RanVaknin RanVaknin added this pull request to the merge queue Sep 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 18, 2025
@RanVaknin RanVaknin added this pull request to the merge queue Sep 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 18, 2025
@RanVaknin RanVaknin added this pull request to the merge queue Sep 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 18, 2025
@RanVaknin RanVaknin force-pushed the feature/master/utils-lite-lambda-trace branch from 4034534 to 73427bb Compare September 18, 2025 17:10
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
77.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@RanVaknin RanVaknin added this pull request to the merge queue Sep 18, 2025
Merged via the queue into master with commit 65a5654 Sep 18, 2025
37 of 38 checks passed
Copy link

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants