Skip to content

Conversation

@grahamalama
Copy link
Contributor

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.

Copy link
Contributor

@bsieber-mozilla bsieber-mozilla left a 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!

@grahamalama grahamalama marked this pull request as ready for review July 28, 2022 15:43
@grahamalama grahamalama requested a review from a team as a code owner July 28, 2022 15:43
@grahamalama grahamalama changed the title [WIP] Improve logging Tweak logging (log 500 requests), other small logging-adjacent tweaks Jul 28, 2022
Copy link
Contributor

@leplatrem leplatrem left a 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)"}}

@grahamalama grahamalama merged commit c51e3eb into main Jul 28, 2022
@grahamalama grahamalama deleted the improve-logging branch July 28, 2022 17:09
@leplatrem leplatrem mentioned this pull request Jul 28, 2022
leplatrem added a commit that referenced this pull request Aug 1, 2022
**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)
@leplatrem leplatrem mentioned this pull request Aug 1, 2022
@leplatrem leplatrem added the enhancement New feature or request label Aug 1, 2022
leplatrem added a commit that referenced this pull request Aug 1, 2022
**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)
grahamalama added a commit that referenced this pull request Aug 2, 2022
This PR ensures that we copy the new asgi.py file (introduced in #161) into the container, which fixes #178.

It also adds a step in the build / publish workflow to spin up the container and check that it starts successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants