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

Sentry update to the code #83

Merged
merged 9 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ dependencies = [
"pytz >= 2023.3",
"structlog >= 23.2.0",
"uvicorn >= 0.24.0",
"numpy==1.26.4"
"numpy==1.26.4",
"sentry-sdk == 2.1.1",
]

[project.optional-dependencies]
Expand Down
13 changes: 12 additions & 1 deletion src/india_api/cmd/main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
"""The main entrypoint to the application."""

import uvicorn
import sentry_sdk

from india_api import internal
from india_api.internal.config import Config
from india_api.internal.service import get_db_client, server
from india_api.internal.service import get_db_client, server, version


peterdudfield marked this conversation as resolved.
Show resolved Hide resolved
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",version)


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