Feature request: avoid tracing API calls made during init (top-level await
)
#2406
Labels
confirmed
The scope is clear, ready for implementation
feature-request
This item refers to a feature request for an existing or new utility
parameters
This item relates to the Parameters Utility
tracer
This item relates to the Tracer Utility
Use case
Currently when using the Parameters and Tracer utility together, and with top-level
await
(like shown below) used in a certain order an error is logged (but not thrown) informing that the X-Ray SDK is unable to find a trace root (expected).This is the log emitted by the AWS X-Ray SDK, which attempts to trace the request made
This is expected in the sense that trace data is available only within the
handler
scope and made available by the AWS Lambda service only when invoking your function.This is not a runtime error (which is also why this is a feature request and not a bug) but nevertheless it's a nuisance and we should try to find a way to handle this case without making the AWS X-Ray SDK log the error.
Note that swapping the order of the Tracer instantiation and the Parameters call, like below, fixes the issue:
Solution/User Experience
The experience for customers should stay as-is and the change should be backwards compatible.
Alternative solutions
No response
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: