Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sentry #58

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions demodjango/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
from pathlib import Path
import dj_database_url
import environ
import sentry_sdk
from dbt_copilot_python.network import setup_allowed_hosts
from dbt_copilot_python.utility import is_copilot
from django_log_formatter_asim import ASIMFormatter
from dotenv import load_dotenv

from dbt_copilot_python.database import database_url_from_env
from sentry_sdk.integrations.django import DjangoIntegration

load_dotenv()

Expand Down Expand Up @@ -230,3 +232,12 @@
CELERY_RESULT_SERIALIZER = "json"
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers.DatabaseScheduler"

SENTRY_DSN = os.getenv("SENTRY_DSN", "")

if SENTRY_DSN:
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[DjangoIntegration()],
traces_sample_rate=1.0,
)
50 changes: 48 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ whitenoise = "^6.6.0"
normality = "^2.5.0"
jinja2 = "^3.1.3"
django-celery-beat = "^2.5.0"
sentry-sdk = "^1.42.0"

[tool.poetry.group.dev.dependencies]
pytest-playwright = "^0.4.4"
Expand Down