Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sentry #133

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,30 @@
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0> for full license details.

import logging

import dash
import dash_bootstrap_components as dbc
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration

import config as cfg

# APP INSTANTIATION & OVERALL LAYOUT
logger = logging.getLogger("uvicorn.error")
# Sentry
if isinstance(cfg.SENTRY_DSN, str):
sentry_sdk.init(
dsn=cfg.SENTRY_DSN,
release=cfg.VERSION,
server_name=cfg.SERVER_NAME,
environment="production" if isinstance(cfg.SERVER_NAME, str) else None,
integrations=[
FlaskIntegration(),
],
traces_sample_rate=1.0,
)
logger.info(f"Sentry middleware enabled on server {cfg.SERVER_NAME}")

# We start by instantiating the app
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.UNITED])
Expand Down
Loading