swh.core.sentry module#

swh.core.sentry.override_with_bool_envvar(envvar: str, default: bool) bool[source]#

Override the default with the environment variable envvar parsed as a boolean

swh.core.sentry.init_sentry(sentry_dsn: Optional[str] = None, *, environment: Optional[str] = None, debug: bool = False, disable_logging_events: bool = False, integrations: Optional[List] = None, extra_kwargs: Optional[Dict] = None)[source]#

Configure the sentry integration

  • sentry_dsn – Sentry DSN; where sentry report will be sent. Overridden by SWH_SENTRY_DSN

  • environment – Sentry environment. Overridden by SWH_SENTRY_ENVIRONMENT

  • debug – turn on Sentry SDK debug mode. Overridden by SWH_SENTRY_DEBUG

  • disable_logging_events – if set, disable the automatic reporting of error/exception log entries as Sentry events. Overridden by SWH_SENTRY_DISABLE_LOGGING_EVENTS

  • integrations – list of dedicated Sentry integrations to include

  • extra_kwargs – dict of additional parameters passed to sentry_sdk.init()