Observability: Grafana dashboard + structured logging + SPA health probes #99
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api#99
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-wkq→ Phase 15 (Production Port) — discovered scope from SPA validationRepo
forgejo_admin/basketball-api+forgejo_admin/pal-e-platform(for Grafana/blackbox config)User Story
As an admin
I want to see API health, auth failures, and error rates in Grafana
So that I can debug issues like "Could not load dashboard data" without SSH-ing into pods
Context
During Phase 15 SPA validation, Lucas hit "Could not load dashboard data" on phone but Playwright showed the API working fine. Debugging required manual kubectl logs, curl with tokens, and guesswork. The observability stack exists (Prometheus, Loki, Grafana, blackbox) but there's no app-level dashboard for basketball-api or the westside SPA.
Basketball-api has a ServiceMonitor and
/metricsendpoint, but no Grafana dashboard consuming the data. Loki collects pod logs but they're unstructured (plain uvicorn access logs). No SPA-side error tracking exists.File Targets
basketball-api:src/basketball_api/main.py— add structured JSON logging middleware (request method, path, status, latency, user_id from token)src/basketball_api/routes/health.py— add/health/readyendpoint that checks DB connectivitypal-e-platformorpal-e-services:westside-dev.tail5b443a.ts.netandwestsidekingsandqueens.tail5b443a.ts.netAcceptance Criteria
Test Expectations
{namespace="basketball-api"} | json | status >= 400returns structured resultsConstraints
/metricsendpointChecklist
Related
plan-pal-e-platform— platform hardening (observability is a core pillar)sop-incident-response— observability feeds incident detectionpal-e-deployments/overlays/basketball-api/Progress: Structured Logging (PR #100 merged)
Completed
logging_config.py— JSON structured logging middleware (method, path, status_code, latency_ms, client_ip, user_agent, user_id from JWT)/health/readyendpoint — DB connectivity check, 200/503Remaining
prometheus-fastapi-instrumentator) —/metricsonly exportsbasketball_api_upcurrently