Added sentry integrations
This commit is contained in:
parent
be3360b919
commit
df29e05b6c
@ -2,6 +2,8 @@ import tempfile
|
|||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import shutil
|
import shutil
|
||||||
|
import sentry_sdk
|
||||||
|
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||||
from flask import Flask, current_app
|
from flask import Flask, current_app
|
||||||
|
|
||||||
from config import Config
|
from config import Config
|
||||||
@ -9,6 +11,18 @@ from config import Config
|
|||||||
from utils import write_file_to_fd_while_calculating_md5, create_md5_sum_for_file
|
from utils import write_file_to_fd_while_calculating_md5, create_md5_sum_for_file
|
||||||
from converter import convert_caff_to_tga, convert_tga_to_png
|
from converter import convert_caff_to_tga, convert_tga_to_png
|
||||||
|
|
||||||
|
# Setup sentry
|
||||||
|
if Config.SENTRY_DSN:
|
||||||
|
sentry_sdk.init(
|
||||||
|
dsn=Config.SENTRY_DSN,
|
||||||
|
integrations=[FlaskIntegration()],
|
||||||
|
traces_sample_rate=1.0,
|
||||||
|
send_default_pii=True,
|
||||||
|
release=Config.RELEASE_ID,
|
||||||
|
environment=Config.RELEASEMODE,
|
||||||
|
_experiments={"auto_enabling_integrations": True}
|
||||||
|
)
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config.from_object(Config)
|
app.config.from_object(Config)
|
||||||
|
|
||||||
|
@ -7,3 +7,6 @@ class Config:
|
|||||||
CONVERSION_TIMEOUT = int(os.environ.get('IMAGEMAGICK_CONVERT_BINARY', 30))
|
CONVERSION_TIMEOUT = int(os.environ.get('IMAGEMAGICK_CONVERT_BINARY', 30))
|
||||||
RECIEVE_CHUNKSIZE = int(os.environ.get('RECIEVE_CHUNKSIZE', 2048))
|
RECIEVE_CHUNKSIZE = int(os.environ.get('RECIEVE_CHUNKSIZE', 2048))
|
||||||
MAX_RECIEVE_SIZE = int(os.environ.get('MAX_RECIEVE_SIZE', 536870912)) # 512 MB
|
MAX_RECIEVE_SIZE = int(os.environ.get('MAX_RECIEVE_SIZE', 536870912)) # 512 MB
|
||||||
|
SENTRY_DSN = os.environ.get('SENTRY_DSN')
|
||||||
|
RELEASE_ID = os.environ.get('RELEASE_ID', 'test')
|
||||||
|
RELEASEMODE = os.environ.get('RELEASEMODE', 'dev')
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
Flask~=1.1.2
|
Flask~=1.1.2
|
||||||
gunicorn~=20.0.4
|
gunicorn~=20.0.4
|
||||||
|
sentry_sdk
|
Loading…
Reference in New Issue
Block a user