From 5b29dc238b5dbf2ade257f2fa669b8ddec34eb9d Mon Sep 17 00:00:00 2001 From: Yuan Chuan Kee Date: Sat, 27 Jun 2020 18:30:30 +0800 Subject: [PATCH] Add sentry --- requirements/prod.txt | 2 +- run.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/requirements/prod.txt b/requirements/prod.txt index ddd6a4b..d2ad9f6 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -4,4 +4,4 @@ gensim==3.4.0 flask_restful==0.3.6 flask-restful-swagger-2==0.35 flask-swagger-ui==3.6.0 -raven[flask]==6.9.0 +sentry-sdk[flask]==0.15.1 diff --git a/run.py b/run.py index f09ab6f..defd018 100644 --- a/run.py +++ b/run.py @@ -1,14 +1,20 @@ import os +import sentry_sdk + from flask.helpers import get_debug_flag -from raven.contrib.flask import Sentry +from sentry_sdk.integrations.flask import FlaskIntegration + from app import create_app from app.settings import ProductionConfig, DevelopmentConfig CONFIG = DevelopmentConfig if get_debug_flag() else ProductionConfig -app = create_app(CONFIG) +sentry_sdk.init( + dsn=os.getenv('SENTRY_DSN'), + integrations=[FlaskIntegration()] +) -sentry = Sentry(app) +app = create_app(CONFIG) if __name__ == '__main__': app.run(host=os.getenv('HOST', default='0.0.0.0'),