integrate sentry error reporting
All checks were successful
Tests / test (push) Successful in 26s

This commit is contained in:
Tobias Brunner 2025-06-04 08:46:20 +02:00
parent bbbe390238
commit 8e12688597
No known key found for this signature in database
4 changed files with 37 additions and 0 deletions

View file

@ -10,9 +10,12 @@ Servala is run using environment variables. Documentation:
"""
import os
import sentry_sdk
from pathlib import Path
from sentry_sdk.integrations.django import DjangoIntegration
from django.contrib import messages
from servala.__about__ import __version__ as version
SERVALA_ENVIRONMENT = os.environ.get("SERVALA_ENVIRONMENT", "development")
DEBUG = SERVALA_ENVIRONMENT == "development"
@ -254,3 +257,13 @@ TIME_ZONE = "UTC"
if SERVALA_ENVIRONMENT in ("staging", "production"):
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
SERVALA_SENTRY_DSN = os.environ.get("SERVALA_SENTRY_DSN")
sentry_sdk.init(
dsn=SERVALA_SENTRY_DSN,
integrations=[DjangoIntegration()],
auto_session_tracking=False,
traces_sample_rate=0.01,
release=version,
environment=SERVALA_ENVIRONMENT,
)