swh.core.sentry module#

swh.core.sentry.get_sentry_release(main_package: str | None = None)[source]#
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: str | None = None, *, main_package: str | None = None, environment: str | None = None, debug: bool = False, disable_logging_events: bool = False, integrations: List | None = None, extra_kwargs: Dict | None = None, deferred_init: bool = False)[source]#

Configure the sentry integration

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

  • main_package – Full name of main Python package associated to Sentry DSN. Overridden by SWH_MAIN_PACKAGE.

  • 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()

  • deferred_init – indicates that sentry will be properly initialized in subsequent calls and that no warnings about missing DSN should be logged