mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds admin-configurability for sentry sample rate (#3277)
This commit is contained in:
parent
1184ca06ac
commit
c71a00e5fb
@ -903,11 +903,13 @@ MARKDOWNIFY_BLEACH = False
|
||||
SENTRY_ENABLED = get_setting('INVENTREE_SENTRY_ENABLED', CONFIG.get('sentry_enabled', False))
|
||||
SENTRY_DSN = get_setting('INVENTREE_SENTRY_DSN', CONFIG.get('sentry_dsn', INVENTREE_DSN))
|
||||
|
||||
SENTRY_SAMPLE_RATE = float(get_setting('INVENTREE_SENTRY_SAMPLE_RATE', CONFIG.get('sentry_sample_rate', 0.1)))
|
||||
|
||||
if SENTRY_ENABLED and SENTRY_DSN: # pragma: no cover
|
||||
sentry_sdk.init(
|
||||
dsn=SENTRY_DSN,
|
||||
integrations=[DjangoIntegration(), ],
|
||||
traces_sample_rate=1.0 if DEBUG else 0.15,
|
||||
traces_sample_rate=1.0 if DEBUG else SENTRY_SAMPLE_RATE,
|
||||
send_default_pii=True
|
||||
)
|
||||
inventree_tags = {
|
||||
|
Loading…
Reference in New Issue
Block a user