Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable tracing only when running on AWS Lambda #572

Closed
Dunedan opened this issue Jul 29, 2021 · 3 comments
Closed

Enable tracing only when running on AWS Lambda #572

Dunedan opened this issue Jul 29, 2021 · 3 comments
Labels
feature-request feature request
Milestone

Comments

@Dunedan
Copy link
Contributor

Dunedan commented Jul 29, 2021

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.

@Dunedan Dunedan added feature-request feature request triage Pending triage from maintainers labels Jul 29, 2021
@heitorlessa
Copy link
Contributor

heitorlessa commented Jul 29, 2021 via email

@michaelbrewer
Copy link
Contributor

@Dunedan - might be fixed in this PR (#598)

@heitorlessa heitorlessa added pending-release Fix or implementation already in dev waiting to be released and removed pending-release Fix or implementation already in dev waiting to be released labels Aug 10, 2021
@heitorlessa
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request
Projects
None yet
Development

No branches or pull requests

3 participants