Skip to content

Commit f8cdfdd

Browse files
codedsuniamareebjamal
authored andcommitted
feat: Integrate sqlalchemy, redis and celery in sentry (#6473)
1 parent f09caa6 commit f8cdfdd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
import sys
77
from flask import Flask, json, make_response
88
from flask_celeryext import FlaskCeleryExt
9+
import sentry_sdk
10+
from sentry_sdk.integrations.flask import FlaskIntegration
11+
from sentry_sdk.integrations.celery import CeleryIntegration
12+
from sentry_sdk.integrations.redis import RedisIntegration
13+
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
14+
915
from app.settings import get_settings, get_setts
1016
from flask_migrate import Migrate, MigrateCommand
1117
from flask_script import Manager
@@ -42,8 +48,6 @@
4248
from app.views.redis_store import redis_store
4349
from app.views.celery_ import celery
4450
from app.templates.flask_ext.jinja.filters import init_filters
45-
import sentry_sdk
46-
from sentry_sdk.integrations.flask import FlaskIntegration
4751

4852

4953
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -173,7 +177,8 @@ def create_app():
173177

174178
# sentry
175179
if not app_created and 'SENTRY_DSN' in app.config:
176-
sentry_sdk.init(app.config['SENTRY_DSN'], integrations=[FlaskIntegration()])
180+
sentry_sdk.init(app.config['SENTRY_DSN'], integrations=[FlaskIntegration(), RedisIntegration(),
181+
CeleryIntegration(), SqlalchemyIntegration()])
177182

178183
# redis
179184
redis_store.init_app(app)

0 commit comments

Comments
 (0)