From 29b73d2d50d28931cbe10432977d5045f6deb1a2 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 4 Sep 2020 16:18:42 -0400 Subject: [PATCH] add sentry support Change-Id: Iaf91e66524fbf3d6c3ed248477084ebffa616a51 --- atmosphere/app.py | 15 +++++++++++++++ requirements.txt | 1 + 2 files changed, 16 insertions(+) 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