Description
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.
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.