From d6b8c528de842b550aca66fbed8dc9390e70d009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=BCleki=20F=C3=A1bi=C3=A1n?= Date: Fri, 8 May 2020 20:08:43 +0200 Subject: [PATCH] fixed sentry stuff --- consumer_api/app.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/consumer_api/app.py b/consumer_api/app.py index 3f5282f..e2829ac 100644 --- a/consumer_api/app.py +++ b/consumer_api/app.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import sentry_sdk +from sentry_sdk.integrations.flask import FlaskIntegration from flask import Flask import os from db import redis_client @@ -14,7 +15,17 @@ __copyright__ = "Copyright 2020, GoldenPogácsa Team" __module_name__ = "app" __version__text__ = "1" -sentry_sdk.init("https://0a106e104e114bc9a3fa47f9cb0db2f4@sentry.kmlabz.com/10") +# Setup sentry +SENTRY_DSN = os.environ.get("SENTRY_DSN") +if SENTRY_DSN: + sentry_sdk.init( + dsn=SENTRY_DSN, + integrations=[FlaskIntegration()], + send_default_pii=True, + release=os.environ.get('RELEASE_ID', 'test'), + environment=os.environ.get('RELEASEMODE', 'dev') + ) + app = Flask(__name__) app.config['REDIS_URL'] = os.environ['REDIS_URL']