Skip to content

Commit

Permalink
Sentry update to the code
Browse files Browse the repository at this point in the history
  • Loading branch information
ADIMANV committed Sep 24, 2024
1 parent a389ced commit 2df152f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ test = [
"pytest >= 8.0.0",
"pytest-cov >= 4.1.0",
"testcontainers == 3.7.1",
sentry-sdk = "^2.1.1",
]
lint = [
"mypy >= 1.7.1",
Expand Down
11 changes: 11 additions & 0 deletions src/india_api/cmd/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""The main entrypoint to the application."""

import uvicorn
import sentry_sdk

from india_api import internal
from india_api.internal.config import Config
Expand All @@ -9,6 +10,16 @@

cfg = Config()

sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN"),
environment=os.getenv("ENVIRONMENT", "local"),
traces_sample_rate=1
)

sentry_sdk.set_tag("app_name", "india_api")
sentry_sdk.set_tag("version", india_api.__version__)


match cfg.SOURCE:
case "indiadb":
if cfg.DB_URL == "" or cfg.DB_URL is None:
Expand Down

0 comments on commit 2df152f

Please sign in to comment.