You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable tracing only when running on AWS Lambda #572
Is your feature request related to a problem? Please describe.
When running code related to an AWS Lambda function outside of AWS Lambda (e.g. when running unit tests or when re-using a function for something else like a CLI script), Tracer with its default configuration fails, as it expects an open X-Ray segment, which usually isn't available in these cases.
That default behavior requires explicitly disabling tracing when not running on AWS Lambda, which is quite annoying and AWS Lambda Powertools could do a better job to simplify things for its users there.
I'd like to see a default behavior where tracing is only enabled if the code is running on AWS Lambda.
Describe alternatives you've considered
An alternative to enable tracing only on AWS Lambda could be to let Tracer create a segment if there isn't already one, however I'm not sure about possible side effects.
On Thu, 29 Jul 2021 at 07:13, Daniel Roschka ***@***.***> wrote:
*Is your feature request related to a problem? Please describe.*
When running code related to an AWS Lambda function outside of AWS Lambda
(e.g. when running unit tests or when re-using a function for something
else like a CLI script), Tracer with its default configuration fails, as
it expects an open X-Ray segment, which usually isn't available in these
cases.
That default behavior requires explicitly disabling tracing when not
running on AWS Lambda, which is quite annoying and AWS Lambda Powertools
could do a better job to simplify things for its users there.
This problem got discussed in detail in #515
<#515>.
*Describe the solution you'd like*
I'd like to see a default behavior where tracing is only enabled if the
code is running on AWS Lambda.
*Describe alternatives you've considered*
An alternative to enable tracing only on AWS Lambda could be to let Tracer
create a segment if there isn't already one, however I'm not sure about
possible side effects.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#572>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBH4XLWD7CX5X3S67JLT2DPQ3ANCNFSM5BFWDJ3Q>
.
Activity
heitorlessa commentedon Jul 29, 2021
michaelbrewer commentedon Aug 10, 2021
@Dunedan - might be fixed in this PR (#598)
heitorlessa commentedon Aug 11, 2021
Now released as part of 1.19.0: https://github.com/awslabs/aws-lambda-powertools-python/releases/tag/v1.19.0