Skip to content

Commit cd649f3

Browse files
committed
Integrate Sentry for error tracking and performance monitoring
1 parent e7b1041 commit cd649f3

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

discord_rss_bot/main.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from typing import TYPE_CHECKING, Annotated, cast
1313

1414
import httpx
15+
import sentry_sdk
1516
import uvicorn
1617
from apscheduler.schedulers.asyncio import AsyncIOScheduler
1718
from fastapi import FastAPI, Form, HTTPException, Request
@@ -947,7 +948,13 @@ def modify_webhook(old_hook: Annotated[str, Form()], new_hook: Annotated[str, Fo
947948

948949

949950
if __name__ == "__main__":
950-
# TODO(TheLovinator): Make this configurable.
951+
sentry_sdk.init(
952+
dsn="https://6e77a0d7acb9c7ea22e85a375e0ff1f4@o4505228040339456.ingest.us.sentry.io/4508792887967744",
953+
send_default_pii=True,
954+
traces_sample_rate=1.0,
955+
_experiments={"continuous_profiling_auto_start": True},
956+
)
957+
951958
uvicorn.run(
952959
"main:app",
953960
log_level="info",

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies = [
1616
"python-dotenv",
1717
"python-multipart",
1818
"reader",
19+
"sentry-sdk[fastapi]",
1920
"uvicorn",
2021
]
2122

@@ -41,6 +42,7 @@ platformdirs = "*"
4142
python-dotenv = "*"
4243
python-multipart = "*"
4344
reader = "*"
45+
sentry-sdk = {version = "*", extras = ["fastapi"]}
4446
uvicorn = "*"
4547

4648
[tool.poetry.group.dev.dependencies]

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ platformdirs
99
python-dotenv
1010
python-multipart
1111
reader
12+
sentry-sdk[fastapi]
1213
uvicorn

0 commit comments

Comments
 (0)