-
Notifications
You must be signed in to change notification settings - Fork 142
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
Segment assumed started under lambda results in exception #137
Comments
Hey, Thank you very much for letting us know about the issue you are having. This new release added official support for the Serverless model. Prior to this, a common work around for customers to use middlewares in Lambda was to override the recorder to use the default context, which is what This update changed the way middlewares behave in Lambda directly. They automatically create subsegments now instead of segments. So it is no longer necessary to override the recorder's Context. So to fix your problem, all you have to do is remove the parameter |
This does indicate an even deeper bug: The middleware should only opt to begin subsegments rather than segments when the LambdaContext is used. That way, middlewares would not suddenly change behaviors when custom contexts are used--even if it's being used in a lambda environment. #138 |
Awesome, removing |
This is a regression from #127
For context this is under lambda execution of zappa/flask and aws-xray-sdk-python is initiated as follows:
Its obvious that this is related to application not being able to start segment (not entirely clear to me why that is happening), however if segment is not found for what ever reason expectation is that application starts (with warning) rather than crash with exception.
Assumption that if code is under lambda it must already have segment created is not entirely accurate?
The text was updated successfully, but these errors were encountered: