Skip to content

Commit

Permalink
Add sentry with test endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
MaertHaekkinen committed Jul 14, 2024
1 parent 07964b7 commit ea04e35
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ajapaik/ajapaik/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,16 @@
url(r'^autocomplete/user-autocomplete/$', UserAutocomplete.as_view(), name='user-autocomplete'),
url(r'^autocomplete/video-autocomplete/$', VideoAutocomplete.as_view(), name='video-autocomplete'),
]

# urls.py
from django.urls import path


def trigger_error(request):
division_by_zero = 1 / 0


urlpatterns += [
path('sentry-debug/', trigger_error),
# ...
]
13 changes: 13 additions & 0 deletions ajapaik/settings/default.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import os
import sys

import sentry_sdk

sentry_sdk.init(
dsn="https://2c3f4a4997ed688907d6820bc2aef251@o4507568002498560.ingest.de.sentry.io/4507568003678288",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)

TEST_RUNNER = 'django.test.runner.DiscoverRunner'

gettext = lambda s: s # noqa
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ sorl-thumbnail==12.7.0
user-agents==2.2.0
pygoogletranslation==2.0.6
roman==3.3
urllib3=1.26.8
sentry-sdk=2.8.0

# Code quality, tests
typing==3.7.4.3
Expand Down

0 comments on commit ea04e35

Please sign in to comment.