-
Notifications
You must be signed in to change notification settings - Fork 26
Tweak logging (log 500 requests), other small logging-adjacent tweaks
#161
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
Conversation
d390697 to
36a82a0
Compare
bsieber-mozilla
left a comment
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.
Thanks for this refactoring, I like the asgi.py addition!
36a82a0 to
c2a3df1
Compare
- use new function to format fields
- use mozlog format for root handler - disable uvicorn access logs - pass config dict to Uvicorn Config
c2a3df1 to
814f53c
Compare
500 requests), other small logging-adjacent tweaks
leplatrem
left a comment
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.
Output of make start looks sound! Great 🎉 Congrats and thanks for being so thorough. Result is super clean 💯
I also tested manually, the backoff logs are showing up:
{"Timestamp": 1659027658763760896, "Type": "backoff", "Logger": "jbi", "Hostname": "ESMAD0166L.transformabcn.com", "EnvVersion": "2.0", "Severity": 6, "Pid": 38891, "Fields": {"msg": "Backing off wrapped_func(...) for 0.6s (bugzilla.exceptions.BugzillaError: boom)"}}
{"Timestamp": 1659027659371533056, "Type": "backoff", "Logger": "jbi", "Hostname": "ESMAD0166L.transformabcn.com", "EnvVersion": "2.0", "Severity": 6, "Pid": 38891, "Fields": {"msg": "Backing off wrapped_func(...) for 0.9s (bugzilla.exceptions.BugzillaError: boom)"}}
{"Timestamp": 1659027660277774080, "Type": "backoff", "Logger": "jbi", "Hostname": "ESMAD0166L.transformabcn.com", "EnvVersion": "2.0", "Severity": 6, "Pid": 38891, "Fields": {"msg": "Backing off wrapped_func(...) for 2.5s (bugzilla.exceptions.BugzillaError: boom)"}}
{"Timestamp": 1659027662731826944, "Type": "backoff", "Logger": "jbi", "Hostname": "ESMAD0166L.transformabcn.com", "EnvVersion": "2.0", "Severity": 3, "Pid": 38891, "Fields": {"msg": "Giving up wrapped_func(...) after 4 tries (bugzilla.exceptions.BugzillaError: boom)"}}
**Bug Fixes** - Retrieve comments from the API if they are private (fixes #154) (#163) **New Features** - Show 'Bug XXXX' instead of Bugzilla Ticket in Jira link (#159) - Add Jira details to log context (#157) - Retry Jira and Bugzilla on error (fixes #33) (#152) - Add counter and timer for action execution (fixes #23, #62, #160, #164) - Tweak logging (log `500` requests), other logging-adjacent tweaks (#161) **Configuration** - Use JB instead of OSS in config.prod.yaml and config.nonprod.yaml (#151, #153) - Add local config for tests (fixes #121) (#138) **Documentation** - Start (naive) troubleshooting section in README (#156) **Internal Changes** - Run app as a single uvicorn process (fixes #133) (#162) - Move initialized action callable to private field (#145) - Do not sleep in retry tests (#158) - Bump sentry-sdk from 1.8.0 to 1.9.0 (#167) - Bump yamllint from 1.26.3 to 1.27.1 (#166) - Bump atlassian-python-api from 3.20.1 to 3.25.0 (#149) - Bump dockerflow from 2022.1.0 to 2022.7.0 (#147) - Bump sentry-sdk from 1.7.2 to 1.8.0 (#146) - Bump detect-secrets from 1.2.0 to 1.3.0 (#148) - Bump mypy from 0.910 to 0.971 (#150)
**Bug Fixes** - Retrieve comments from the API if they are private (fixes #154) (#163) **New Features** - Show 'Bug XXXX' instead of Bugzilla Ticket in Jira link (#159) - Add Jira details to log context (#157) - Retry Jira and Bugzilla on error (fixes #33) (#152) - Add counter and timer for action execution (fixes #23, #62, #160, #164) - Tweak logging (log `500` requests), other logging-adjacent tweaks (#161) **Configuration** - Use JB instead of OSS in config.prod.yaml and config.nonprod.yaml (#151, #153) - Add local config for tests (fixes #121) (#138) **Documentation** - Start (naive) troubleshooting section in README (#156) **Internal Changes** - Run app as a single uvicorn process (fixes #133) (#162) - Move initialized action callable to private field (#145) - Do not sleep in retry tests (#158) - Bump sentry-sdk from 1.8.0 to 1.9.0 (#167) - Bump yamllint from 1.26.3 to 1.27.1 (#166) - Bump atlassian-python-api from 3.20.1 to 3.25.0 (#149) - Bump dockerflow from 2022.1.0 to 2022.7.0 (#147) - Bump sentry-sdk from 1.7.2 to 1.8.0 (#146) - Bump detect-secrets from 1.2.0 to 1.3.0 (#148) - Bump mypy from 0.910 to 0.971 (#150) - Bump fastapi from 0.73.0 to 0.79.0 (#168)
Commits and the final product of this PR are definitely in a WIP state, but I'd like feedback now to make sure we're on the right path for our logging config.