-
Notifications
You must be signed in to change notification settings - Fork 143
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
Middlewares should create subsegments only when in the Lambda context running under a Lambda environment #138
Comments
Case Study: Using the default Context in a Lambda environmentPrior to PR #127, using the default And for completeness, this is what the Service graph looks like after the PR using the With the introduction of the PR, middlewares generated subsegments inside Lambda environments and caused SegmentMissingExceptions whenever the default |
…nvironment (aws#138) * Added unit tests to ensure these frameworks generate segmentby default and subsegments if in lambda context and environment.
…nvironment (aws#138) * Added unit tests to ensure these frameworks generate segmentby default and subsegments if in lambda context and environment.
…nvironment (aws#138) * Added unit tests to ensure these frameworks generate segmentby default and subsegments if in lambda context and environment.
The current behavior of the Middlewares is that it opts to generate subsegments only if the current execution environment is in lambda, otherwise it generates segments.
This is problematic if customers choose to create their own custom context and proceed to use that context in a Lambda environment. If for example the custom context is designed to allow users to call put_segment and end_segment, the middlewares would still call begin_subsegment if the context is run in a Lambda environment.
The expected behavior of the middleware is to only generate subsegments if it's in a Lambda context running in the Lambda environment, and if the middleware is run otherwise, it should only generate segments.
The text was updated successfully, but these errors were encountered: