mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
feat(app): add sentry loging
This commit is contained in:
5
.github/workflows/deploy-prod.yaml
vendored
5
.github/workflows/deploy-prod.yaml
vendored
@@ -85,7 +85,7 @@ jobs:
|
||||
BANKID_CLIENT_SECRET: ${{ secrets.BANKID_CLIENT_SECRET }}
|
||||
MOJEID_CLIENT_ID: ${{ secrets.MOJEID_CLIENT_ID }}
|
||||
MOJEID_CLIENT_SECRET: ${{ secrets.MOJEID_CLIENT_SECRET }}
|
||||
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
run: |
|
||||
helm upgrade --install myapp ./7project/charts/myapp-chart \
|
||||
-n prod --create-namespace \
|
||||
@@ -101,4 +101,5 @@ jobs:
|
||||
--set-string oauth.bankid.clientId="$BANKID_CLIENT_ID" \
|
||||
--set-string oauth.bankid.clientSecret="$BANKID_CLIENT_SECRET" \
|
||||
--set-string oauth.mojeid.clientId="$MOJEID_CLIENT_ID" \
|
||||
--set-string oauth.mojeid.clientSecret="$MOJEID_CLIENT_SECRET"
|
||||
--set-string oauth.mojeid.clientSecret="$MOJEID_CLIENT_SECRET" \
|
||||
--set-string sentry_dsn="$SENTRY_DSN" \
|
||||
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
from fastapi import Depends, FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
@@ -9,6 +11,16 @@ from app.api.categories import router as categories_router
|
||||
from app.api.transactions import router as transactions_router
|
||||
from app.services.user_service import auth_backend, current_active_verified_user, fastapi_users, get_oauth_provider
|
||||
|
||||
|
||||
from fastapi import FastAPI
|
||||
import sentry_sdk
|
||||
|
||||
sentry_sdk.init(
|
||||
dsn=os.getenv("SENTRY_DSN"),
|
||||
send_default_pii=True,
|
||||
)
|
||||
|
||||
app = FastAPI()
|
||||
fastApi = FastAPI()
|
||||
|
||||
# CORS for frontend dev server
|
||||
@@ -59,3 +71,7 @@ async def root():
|
||||
@fastApi.get("/authenticated-route")
|
||||
async def authenticated_route(user: User = Depends(current_active_verified_user)):
|
||||
return {"message": f"Hello {user.email}!"}
|
||||
|
||||
@fastApi.get("/sentry-debug")
|
||||
async def trigger_error():
|
||||
division_by_zero = 1 / 0
|
||||
@@ -50,6 +50,7 @@ python-dateutil==2.9.0.post0
|
||||
python-dotenv==1.1.1
|
||||
python-multipart==0.0.20
|
||||
PyYAML==6.0.2
|
||||
sentry-sdk==2.42.0
|
||||
six==1.17.0
|
||||
sniffio==1.3.1
|
||||
SQLAlchemy==2.0.43
|
||||
@@ -58,6 +59,7 @@ tomli==2.2.1
|
||||
typing-inspection==0.4.1
|
||||
typing_extensions==4.15.0
|
||||
tzdata==2025.2
|
||||
urllib3==2.5.0
|
||||
uvicorn==0.37.0
|
||||
uvloop==0.21.0
|
||||
vine==5.1.0
|
||||
|
||||
@@ -15,3 +15,4 @@ stringData:
|
||||
# RabbitMQ credentials
|
||||
RABBITMQ_PASSWORD: {{ .Values.rabbitmq.password | default "" | quote }}
|
||||
RABBITMQ_USERNAME: {{ .Values.rabbitmq.username | quote }}
|
||||
SENTRY_DSN: {{ .Values.sentry_dsn | quote }}
|
||||
|
||||
@@ -16,6 +16,8 @@ domain_scheme: ""
|
||||
frontend_domain: ""
|
||||
frontend_domain_scheme: ""
|
||||
|
||||
sentry_dsn: ""
|
||||
|
||||
image:
|
||||
repository: lukastrkan/cc-app-demo
|
||||
# You can use a tag or digest. If digest is provided, it takes precedence.
|
||||
|
||||
Reference in New Issue
Block a user