mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
(cherry picked from commit cdb445583b8d1949d9c0294aae546c96ab1a4926) Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
af0a2822d1
commit
2f1e3817f1
@ -67,6 +67,10 @@ def init_sentry(dsn, sample_rate, tags):
|
|||||||
|
|
||||||
def report_exception(exc):
|
def report_exception(exc):
|
||||||
"""Report an exception to sentry.io."""
|
"""Report an exception to sentry.io."""
|
||||||
|
if settings.TESTING:
|
||||||
|
# Skip reporting exceptions in testing mode
|
||||||
|
return
|
||||||
|
|
||||||
if settings.SENTRY_ENABLED and settings.SENTRY_DSN:
|
if settings.SENTRY_ENABLED and settings.SENTRY_DSN:
|
||||||
if not any(isinstance(exc, e) for e in sentry_ignore_errors()):
|
if not any(isinstance(exc, e) for e in sentry_ignore_errors()):
|
||||||
logger.info('Reporting exception to sentry.io: %s', exc)
|
logger.info('Reporting exception to sentry.io: %s', exc)
|
||||||
|
@ -873,7 +873,7 @@ SENTRY_SAMPLE_RATE = float(
|
|||||||
get_setting('INVENTREE_SENTRY_SAMPLE_RATE', 'sentry_sample_rate', 0.1)
|
get_setting('INVENTREE_SENTRY_SAMPLE_RATE', 'sentry_sample_rate', 0.1)
|
||||||
)
|
)
|
||||||
|
|
||||||
if SENTRY_ENABLED and SENTRY_DSN: # pragma: no cover
|
if SENTRY_ENABLED and SENTRY_DSN and not TESTING: # pragma: no cover
|
||||||
init_sentry(SENTRY_DSN, SENTRY_SAMPLE_RATE, inventree_tags)
|
init_sentry(SENTRY_DSN, SENTRY_SAMPLE_RATE, inventree_tags)
|
||||||
|
|
||||||
# OpenTelemetry tracing
|
# OpenTelemetry tracing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user