Skip to content

Conversation

@svozza
Copy link
Contributor

@svozza svozza commented Oct 28, 2025

Summary

Last week we had to revert several PRs dies to an issue with the InvokeStore module. This module has now been patched.

This PR re-introduces the module, which means we now fetch the X-ray trace id from AsyncLocalStorage if it is available and an environment variable if not..

Changes

Updated the getXrayTraceDataFromEnv function in envUtils to check AsyncLocalStorage first and fall back to the _X_AMZN_TRACE_ID environment variable otherwise.

Also updated the envUtils tests to use unstubAllEnvs rather than directly mutate process.env.

Issue number: closes #4657


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@svozza svozza self-assigned this Oct 28, 2025
@boring-cyborg boring-cyborg bot added commons This item relates to the Commons Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. tests PRs that add or change tests labels Oct 28, 2025
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Oct 28, 2025
@svozza svozza requested a review from sdangol October 28, 2025 17:24
@svozza svozza changed the title Invoke store x ray improv(commons): Make trace ID access more robust Oct 28, 2025
@sonarqubecloud
Copy link

Copy link
Contributor

@sdangol sdangol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works now! Thanks for the PR and also fixing the library

@svozza svozza merged commit b26cd2c into main Oct 28, 2025
49 checks passed
@svozza svozza deleted the invoke-store-x-ray branch October 28, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commons This item relates to the Commons Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. size/L PRs between 100-499 LOC tests PRs that add or change tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintenance: Leverage new InvokeStore module to keep track of X-RAY trace id

2 participants