-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Add Status Code and Request and Response Bodies to Logs #1358
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
base: main
Are you sure you want to change the base?
Conversation
| ) | ||
|
|
||
| extra = { | ||
| "request_body": request_body, |
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.
The response body could be massive (in theory), this is why the FastAPI tracing does not set it as an attribute by default, rather they recommend truncating it when manually adding it to the trace, if it is over a certain length. So it could be useful to add this modality, possibly as a selectable option that defaults to truncate=true as there may legitimately be times when you want to see the whole response to a particular request in the log.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1358 +/- ##
=======================================
Coverage 95.01% 95.02%
=======================================
Files 43 43
Lines 2768 2773 +5
=======================================
+ Hits 2630 2635 +5
Misses 138 138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Could we add some logging (possibly at debug?) when the request is received as well? Running a plan with this logging now gives something like where the plan appears to start before the request that started it. Making the |
Logs now have status code. Logs now have request and response bodies as attributes to log record (accessible via Graylog). Logs now look prettier.
Example: