Skip to content

Commit d37cec3

Browse files
committed
Adding sentry config
1 parent eb456da commit d37cec3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packet/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
The application setup and initialization code lives here
33
"""
44

5-
import os
6-
import logging
75
import json
6+
import logging
7+
import os
88

99
import csh_ldap
1010
import onesignal
11+
import sentry_sdk
1112
from flask import Flask
1213
from flask_gzip import Gzip
1314
from flask_migrate import Migrate
1415
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
1516
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata
1617
from flask_sqlalchemy import SQLAlchemy
18+
from sentry_sdk.integrations.flask import FlaskIntegration
1719

1820
app = Flask(__name__)
1921
gzip = Gzip(app)
@@ -60,6 +62,12 @@
6062
# LDAP
6163
_ldap = csh_ldap.CSHLDAP(app.config['LDAP_BIND_DN'], app.config['LDAP_BIND_PASS'])
6264

65+
# Sentry
66+
sentry_sdk.init(
67+
dsn=app.config['SENTRY_DSN'],
68+
integrations=[FlaskIntegration()]
69+
)
70+
6371
app.logger.info('OIDCAuth and LDAP configured')
6472

6573
# pylint: disable=wrong-import-position

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ gunicorn~=19.7.1
1010
csh_ldap~=2.1.0
1111
onesignal-sdk~=1.0.0
1212
pylint-quotes~=0.2.1
13+
sentry-sdk[flask]==0.13.1

0 commit comments

Comments
 (0)