further sentry integrations
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
040c9f2399
commit
56720701b1
15
src/app.py
15
src/app.py
@ -4,6 +4,7 @@ from flask import Flask
|
||||
from flask_restful import Api
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
from sentry_sdk.integrations.logging import LoggingIntegration
|
||||
|
||||
from resources import *
|
||||
from config import *
|
||||
@ -21,12 +22,18 @@ __module_name__ = "app"
|
||||
__version__text__ = "1"
|
||||
|
||||
if SENTRY_DSN:
|
||||
sentry_logging = LoggingIntegration(
|
||||
level=logging.DEBUG,
|
||||
event_level=logging.ERROR
|
||||
)
|
||||
sentry_sdk.init(
|
||||
dsn=SENTRY_DSN,
|
||||
integrations=[FlaskIntegration()],
|
||||
integrations=[FlaskIntegration(), sentry_logging],
|
||||
traces_sample_rate=1.0,
|
||||
send_default_pii=True,
|
||||
release=RELEASE_ID,
|
||||
environment=RELEASEMODE
|
||||
environment=RELEASEMODE,
|
||||
_experiments={"auto_enabling_integrations": True}
|
||||
)
|
||||
|
||||
app = Flask(__name__)
|
||||
@ -35,8 +42,8 @@ app.config['MQTT_BROKER_PORT'] = MQTT_PORT
|
||||
app.config['MQTT_USERNAME'] = MQTT_USERNAME
|
||||
app.config['MQTT_PASSWORD'] = MQTT_PASSWORD
|
||||
app.config['MQTT_REFRESH_TIME'] = 1.0 # refresh time in seconds
|
||||
app.config[
|
||||
'SQLALCHEMY_DATABASE_URI'] = f"postgresql://{POSTGRES_USERNAME}:{POSTGRES_PASSWORD}@{POSTGRES_HOSTNAME}:5432/{POSTGRES_DB}"
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] =\
|
||||
f"postgresql://{POSTGRES_USERNAME}:{POSTGRES_PASSWORD}@{POSTGRES_HOSTNAME}:5432/{POSTGRES_DB}"
|
||||
|
||||
api = Api(app)
|
||||
db.init_app(app)
|
||||
|
Loading…
Reference in New Issue
Block a user