Page MenuHomeSoftware Heritage

statsd: add an error_type tag to @timed error counters
ClosedPublic

Authored by olasd on Apr 13 2022, 4:00 PM.

Details

Summary

This will give us a rough classification of the errors of timed
functions, which will allow us to keep track of trends, without having
to report all errors to sentry for analysis.

Test Plan

@timed error tests updated to check for the new tag

Diff Detail

Repository
rDCORE Foundations and core functionalities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D7569 (id=27422)

Could not rebase; Attempt merge onto ab170ca98c...

Updating ab170ca..e160633
Fast-forward
 swh/core/api/__init__.py                     | 19 +++++++
 swh/core/api/gunicorn_config.py              |  4 +-
 swh/core/api/tests/test_gunicorn.py          | 75 ++++++++++++++++++----------
 swh/core/api/tests/test_rpc_client_server.py | 34 ++++++++++++-
 swh/core/sentry.py                           | 23 ++++++++-
 swh/core/statsd.py                           | 20 +++++---
 swh/core/tests/test_statsd.py                |  6 ++-
 7 files changed, 141 insertions(+), 40 deletions(-)
Changes applied before test
commit e160633523610e0de87bb3672eaae3da99a4a5b4
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Apr 13 15:57:02 2022 +0200

    statsd: add an error_type tag to @timed error counters
    
    This will give us a rough classification of the errors of timed
    functions, which will allow us to keep track of trends, without having
    to report all errors to sentry for analysis.

commit 0b89e6b1acba7d902914dc31d4f3da3eacd6d350
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Apr 13 15:05:19 2022 +0200

    gunicorn: disable sentry logging event reporting by default
    
    By default, sentry's logging integration will report any error or
    exception-level logging as an event.
    
    Now that we explicitly capture exceptions in the RPC server app, we can
    disable this automatic event generation, and only use the logging
    integration to generate breadcrumbs.

commit a310dd84f8c080019fd00bd4220c9c0c7ab7b532
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Apr 13 14:54:20 2022 +0200

    sentry: don't use mutable values as default arguments

commit b0fff3225d3078e3fcb81bef6bdbe5407b600d17
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Apr 13 14:16:45 2022 +0200

    RPC server: explicitly handle sentry exception capture
    
    The error handler for RPC server classes is used for both unexpected
    exceptions (using a 5xx status code), and exceptions used for the normal
    execution flow, which are encoded on the server side, and decoded to be
    raised again on the client side (and use a 4xx status code). We only
    record sentry errors for the 5xx class exceptions.

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/391/ for more details.

olasd requested review of this revision.Apr 13 2022, 4:01 PM
This revision is now accepted and ready to land.Apr 13 2022, 4:04 PM

Build is green

Patch application report for D7569 (id=27436)

Rebasing onto ab170ca98c...

Current branch diff-target is up to date.
Changes applied before test
commit c7f1b6880b965f031eb87b70cf7011aa9e89be46
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Apr 13 15:57:02 2022 +0200

    statsd: add an error_type tag to @timed error counters
    
    This will give us a rough classification of the errors of timed
    functions, which will allow us to keep track of trends, without having
    to report all errors to sentry for analysis.

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/393/ for more details.