Skip to content

Commit cbafe60

Browse files
committed
Add Redis and Celery to Sentry monitoring
1 parent 6df4245 commit cbafe60

File tree

3 files changed

+38
-25
lines changed

3 files changed

+38
-25
lines changed

config/settings/production.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,16 +252,29 @@
252252
if SENTRY_DSN:
253253
# pylint: disable=import-error
254254
import sentry_sdk
255+
from sentry_sdk.integrations.celery import CeleryIntegration
255256
from sentry_sdk.integrations.django import DjangoIntegration
256257
from sentry_sdk.integrations.logging import LoggingIntegration
257258
from sentry_sdk.integrations.logging import ignore_logger
259+
from sentry_sdk.integrations.redis import RedisIntegration
258260

259261
sentry_logging = LoggingIntegration(
260262
event_level=logging.WARNING # Send warnings as events
261263
)
262264
ignore_logger("django.security.DisallowedHost")
263265

264-
sentry_sdk.init(dsn=SENTRY_DSN, integrations=[sentry_logging, DjangoIntegration()])
266+
sentry_sdk.init(
267+
dsn=SENTRY_DSN,
268+
integrations=[
269+
sentry_logging,
270+
# https://docs.sentry.io/platforms/python/integrations/django/#options
271+
DjangoIntegration(),
272+
# https://docs.sentry.io/platforms/python/integrations/celery/#options
273+
CeleryIntegration(monitor_beat_tasks=True),
274+
# https://docs.sentry.io/platforms/python/integrations/redis/#options
275+
RedisIntegration(),
276+
],
277+
)
265278

266279

267280
# Production ad server specific settings

requirements/production.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ django-storages[azure]
2424

2525
# Logging and monitoring
2626
newrelic
27-
sentry-sdk
27+
sentry-sdk[celery,django]

requirements/production.txt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#
77
aiohappyeyeballs==2.6.1
88
# via aiohttp
9-
aiohttp==3.13.1
9+
aiohttp==3.13.2
1010
# via geoip2
1111
aiosignal==1.4.0
1212
# via aiohttp
1313
amqp==5.3.1
1414
# via kombu
15-
asgiref==3.10.0
15+
asgiref==3.11.0
1616
# via
1717
# django
1818
# django-allauth
@@ -28,23 +28,25 @@ azure-core==1.36.0
2828
# via
2929
# azure-storage-blob
3030
# django-storages
31-
azure-storage-blob==12.27.0
31+
azure-storage-blob==12.27.1
3232
# via django-storages
33-
billiard==4.2.2
33+
billiard==4.2.3
3434
# via celery
35-
bleach==6.2.0
35+
bleach==6.3.0
3636
# via -r base.in
3737
celery[redis]==5.5.0rc1
38-
# via -r base.in
39-
certifi==2025.10.5
38+
# via
39+
# -r base.in
40+
# sentry-sdk
41+
certifi==2025.11.12
4042
# via
4143
# requests
4244
# sentry-sdk
4345
cffi==2.0.0
4446
# via cryptography
4547
charset-normalizer==3.4.4
4648
# via requests
47-
click==8.3.0
49+
click==8.3.1
4850
# via
4951
# celery
5052
# click-didyoumean
@@ -80,15 +82,16 @@ django==5.2.8
8082
# django-storages
8183
# djangorestframework
8284
# jsonfield
83-
django-allauth[mfa]==65.12.1
85+
# sentry-sdk
86+
django-allauth[mfa]==65.13.1
8487
# via -r base.in
8588
django-anymail==13.1
8689
# via -r production.in
8790
django-cors-headers==4.9.0
8891
# via -r base.in
89-
django-countries==7.6.1
92+
django-countries==8.1.1
9093
# via -r base.in
91-
django-crispy-forms==2.4
94+
django-crispy-forms==2.5
9295
# via
9396
# -r base.in
9497
# crispy-bootstrap4
@@ -132,21 +135,21 @@ idna==3.11
132135
# via
133136
# requests
134137
# yarl
135-
ip2proxy==3.5.2
138+
ip2proxy==3.6.0
136139
# via -r base.in
137140
isodate==0.7.2
138141
# via azure-storage-blob
139142
jsonfield==3.2.0
140143
# via -r base.in
141-
kombu==5.5.4
144+
kombu==5.6.0
142145
# via celery
143146
maxminddb==2.8.2
144147
# via geoip2
145148
multidict==6.7.0
146149
# via
147150
# aiohttp
148151
# yarl
149-
newrelic==11.0.1
152+
newrelic==11.1.0
150153
# via -r production.in
151154
packaging==25.0
152155
# via
@@ -160,11 +163,11 @@ propcache==0.4.1
160163
# via
161164
# aiohttp
162165
# yarl
163-
psycopg[binary,pool]==3.2.11
166+
psycopg[binary,pool]==3.2.12
164167
# via -r production.in
165-
psycopg-binary==3.2.11
168+
psycopg-binary==3.2.12
166169
# via psycopg
167-
psycopg-pool==3.2.6
170+
psycopg-pool==3.2.7
168171
# via psycopg
169172
pycparser==2.23
170173
# via cffi
@@ -189,7 +192,7 @@ requests==2.32.5
189192
# django-slack
190193
# geoip2
191194
# stripe
192-
sentry-sdk==2.42.1
195+
sentry-sdk[celery,django]==2.45.0
193196
# via -r production.in
194197
six==1.17.0
195198
# via python-dateutil
@@ -238,10 +241,7 @@ whitenoise==6.11.0
238241
# via -r base.in
239242
yarl==1.22.0
240243
# via aiohttp
241-
zope-event==6.0
244+
zope-event==6.1
242245
# via gevent
243-
zope-interface==8.0.1
246+
zope-interface==8.1.1
244247
# via gevent
245-
246-
# The following packages are considered to be unsafe in a requirements file:
247-
# setuptools

0 commit comments

Comments
 (0)