-
Notifications
You must be signed in to change notification settings - Fork 12
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
bootstrapping the xray sdk/middleware #1923
Conversation
🧪 Review environmenthttps://jk4aux2btzatf47iomawbfhopq0tfcdn.lambda-url.ca-central-1.on.aws/ |
app/__init__.py
Outdated
@@ -699,6 +700,9 @@ def useful_headers_after_request(response): | |||
|
|||
def register_errorhandlers(application): # noqa (C901 too complex) | |||
def _error_response(error_code): | |||
|
|||
xray_recorder.begin_segment("error_response") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we need to call xray_recorder.end_segment
somewhere? The basic usage doc mentions it might have to be called before begin_segment
sometimes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder too if x-ray would detect the error segment automatically with the error response that is generated. Are we testing the segment feature of x-ray here or trying to fix an issue where x-ray fails to detect errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added as a failsafe for certain errors where the code path results in an empty/null segment. This code will verify that all errors are working as expected and that x-ray is still reporting traces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stay tuned for code updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Let's also monitor if that slows down our application boot up significantly (i.e. like NewRelic latest updates).
Summary | Résumé
Just like the title says :)
add the middleware and sdk to admin for aws Xray.
Includes a fix for 500s when it should be a 404 on xxxxxxx/services/wrongendpoint
https://app.zenhub.com/workspaces/notify-planning-core-6411dfb7c95fb80014e0cab0/issues/gh/cds-snc/notification-planning-core/319
Reviewer checklist | Liste de vérification du réviseur