Page MenuHomeSoftware Heritage

Add support for disabling logging integration in sentry
ClosedPublic

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

Details

Summary

add a configuration option to init_sentry to disable the error reporting
from logging by sentry.

This can be set via the SWH_SENTRY_DISABLE_LOGGING_INTEGRATION env var.
Defaulti behavior remains unchanged.

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 D7570 (id=27423)

Rebasing onto ab170ca98c...

First, rewinding head to replay your work on top of it...
Applying: Add support for disabling logging integration in sentry
Changes applied before test
commit 80319016e43797027c9bce8a08f46935b41b3443
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed Apr 13 15:54:50 2022 +0200

    Add support for disabling logging integration in sentry
    
    add a configuration option to init_sentry to disable the error reporting
    from logging by sentry.
    
    This can be set via the SWH_SENTRY_DISABLE_LOGGING_INTEGRATION env var.
    Defaulti behavior remains unchanged.

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

We also implemented something similar in D7567 but your tests are much better than ours.

This revision is now accepted and ready to land.Apr 13 2022, 4:32 PM
swh/core/sentry.py
33

documentation of that parameter seems truncated.

Build is green

Patch application report for D7570 (id=27441)

Rebasing onto 5723f00a2a...

Current branch diff-target is up to date.
Changes applied before test
commit 2b4c89418d27d3431baebbe06dda7886e537e81e
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed Apr 13 15:54:50 2022 +0200

    Add support for disabling logging integration in sentry
    
    add a configuration option to init_sentry to disable the error reporting
    from logging by sentry.
    
    This can be set via the SWH_SENTRY_DISABLE_LOGGING_INTEGRATION env var.
    Defaulti behavior remains unchanged.

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

olasd added a reviewer: douardda.
olasd removed a reviewer: douardda.

Improve docs, rename variable to disable_logging_events

Build is green

Patch application report for D7570 (id=27443)

Rebasing onto 5723f00a2a...

Current branch diff-target is up to date.
Changes applied before test
commit b9b898e3375374446838c8eda1fe33f64b3d232f
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Thu Apr 14 11:24:26 2022 +0200

    Add support for disabling logging-based events in sentry
    
    add a configuration option to init_sentry to disable the error reporting
    from logging by sentry.
    
    This can be set via the SWH_SENTRY_DISABLE_LOGGING_EVENTS env var.
    Default behavior remains unchanged.
    
    Co-Authored-By: David Douard <david.douard@sdfa3.org>

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

olasd edited reviewers, added: douardda; removed: Reviewers.
anlambert added inline comments.
swh/core/sentry.py
28–29

Optional[bool] feels weird to me, using simply bool defaulted to False is easier to read.

This revision is now accepted and ready to land.Apr 14 2022, 11:52 AM
swh/core/sentry.py
28–29

Yeah, I agree; but currently we actually use the three states: None = default -> use environment variable, True/False -> use that value explicitly and ignore the environment variable.

swh/core/sentry.py
28–29

Oh I see.

swh/core/sentry.py
28–29

D7580 makes this clearer altogether.