Skip to content

Feature/master/utils lite lambda trace again#6433

Merged
joviegas merged 22 commits intomasterfrom
feature/master/utils-lite-lambda-trace-again
Sep 19, 2025
Merged

Feature/master/utils lite lambda trace again#6433
joviegas merged 22 commits intomasterfrom
feature/master/utils-lite-lambda-trace-again

Conversation

@RanVaknin
Copy link
Copy Markdown
Contributor

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 19, 2025 00:19
@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 19, 2025
@RanVaknin RanVaknin force-pushed the feature/master/utils-lite-lambda-trace-again branch from 4e024c0 to f02ff03 Compare September 19, 2025 05:30
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@joviegas joviegas added this pull request to the merge queue Sep 19, 2025
Merged via the queue into master with commit 3c142fb Sep 19, 2025
37 of 38 checks passed
@github-actions
Copy link
Copy Markdown

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 19, 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