diff --git a/atmosphere/app.py b/atmosphere/app.py index 8c69c2c..d8cac63 100644 --- a/atmosphere/app.py +++ b/atmosphere/app.py @@ -16,12 +16,27 @@ """ import os +import pkg_resources +import sentry_sdk from flask import Flask +from sentry_sdk.integrations.flask import FlaskIntegration +from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration from atmosphere import models +VERSION = pkg_resources.get_distribution("atmosphere").version + +sentry_sdk.init( + release="atmosphere@%s" % VERSION, + integrations=[ + FlaskIntegration(), + SqlalchemyIntegration() + ], +) + + def create_app(config=None): """create_app""" app = Flask(__name__) diff --git a/requirements.txt b/requirements.txt index f17f5d5..048873f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ Flask-SQLAlchemy keystonemiddleware python-dateutil PyMySQL +sentry-sdk[flask] \ No newline at end of file