Skip to content

Commit 4748bdd

Browse files
authored
Merge pull request #31 from Jany26/sentry-setup
Configuring Sentry
2 parents 5db67bf + 5dee10e commit 4748bdd

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ to the value in their `Authorization` header.
5151

5252
For example `Authorization: Bearer secret-123`.
5353

54+
Additionally, for Sentry error and performance monitoring, `LD_PACKIT_INTERFACE_SENTRY_DSN` environment variable has to be set.
55+
5456
## Run the container
5557

5658
Images are published to quay.io. If it isn't available, or if you want

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dependencies = [
1111
"fastapi>=0.120.2",
1212
"fedora-messaging>=3.8.0",
1313
"gunicorn>=23.0.0",
14+
"sentry_sdk>=2.17.0,<3.0.0",
1415
"httpx>=0.28.1",
1516
"pydantic>=2.12.3",
1617
"ruff>=0.14.2",

src/logdetective_packit/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from fastapi import FastAPI, Depends, HTTPException, status
1111
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
12+
import sentry_sdk
1213

1314
from httpx import AsyncClient, HTTPStatusError
1415
from fedora_messaging.api import publish, Message
@@ -33,6 +34,11 @@
3334

3435
http_bearer = HTTPBearer()
3536

37+
# Set the LD_PACKIT_INTERFACE_SENTRY_DSN env variable beforehand
38+
sentry_sdk.init(
39+
dsn=os.environ.get("LD_PACKIT_INTERFACE_SENTRY_DSN")
40+
)
41+
3642
app = FastAPI(title="LogDetectivePackit", version=version("logdetective-packit"))
3743

3844
# Setup logging for fedora-messaging

uv.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)