You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 038d94b
Browse filesBrowse the repository at this point in the historyBrowse files
feat(observability): add Prometheus metrics and Grafana dashboards
Exposes a /metrics endpoint from the Go backend using promhttp, instruments
all HTTP routes with request count and latency histograms, and exports DB
connection pool stats via a custom prometheus.Collector. Prometheus and Grafana
are wired into Docker Compose (ports 9090 and 3001) with a provisioned data
source and starter dashboard covering request rate, p50/p95 latency, and DB
pool connections. Closes#17.
Copy file name to clipboardExpand all lines: backend/docs/environment.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,8 @@ This runs on package init before any env var is read — no explicit `godotenv.L
34
34
|`RATE_LIMIT_BURST`|`bootstrap.go`|`int(RPS) * 5`, min 1 | Token-bucket burst capacity. Derived as `int(RPS)*5` when omitted; clamped to 1 so fractional RPS values never block all traffic. |
35
35
|`FIREBASE_PROJECT_ID`|`bootstrap.go`, `pkg/firebase/admin.go`| — | Firebase project ID. When omitted the Firebase Admin client is not initialised and `FirebaseAuth` middleware is skipped (auth disabled). |
36
36
|`FIREBASE_SERVICE_ACCOUNT_JSON`|`bootstrap.go`, `pkg/firebase/admin.go`| — | Raw JSON content of a Firebase service account key file. When omitted the SDK falls back to Application Default Credentials (ADC) — appropriate for GCP-hosted deployments. Only relevant when `FIREBASE_PROJECT_ID` is set. |
37
+
|`REDIS_URL`|`bootstrap.go`| — | Redis connection URL. When omitted or empty, cache/Redis initialization is skipped and the app runs without Redis. |
38
+
|`BLUEPRINT_WS_ALLOWED_ORIGIN`|`internal/transport/handlers/ws_handler.go`| — | Allowed origin for WebSocket CORS checks in staging/production. When omitted, WebSocket origin validation is skipped (local dev). |
37
39
38
40
Variables marked **required** are validated by `bootstrap.validateConfig` at startup — the process exits before attempting a DB connection if any are missing.
Copy file name to clipboardExpand all lines: backend/docs/swagger/docs.go
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,25 @@ const docTemplate = `{
98
98
}
99
99
}
100
100
},
101
+
"/metrics": {
102
+
"get": {
103
+
"produces": [
104
+
"text/plain"
105
+
],
106
+
"tags": [
107
+
"observability"
108
+
],
109
+
"summary": "Prometheus metrics",
110
+
"responses": {
111
+
"200": {
112
+
"description": "Prometheus exposition format",
113
+
"schema": {
114
+
"type": "string"
115
+
}
116
+
}
117
+
}
118
+
}
119
+
},
101
120
"/ws": {
102
121
"get": {
103
122
"description": "Upgrades HTTP to WebSocket. Pass a Firebase ID token as `+"`"+`?token=\u003ctoken\u003e`+"`"+`. Returns 401 when the token is missing or invalid.",
Copy file name to clipboardExpand all lines: backend/docs/swagger/swagger.json
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,25 @@
92
92
}
93
93
}
94
94
},
95
+
"/metrics": {
96
+
"get": {
97
+
"produces": [
98
+
"text/plain"
99
+
],
100
+
"tags": [
101
+
"observability"
102
+
],
103
+
"summary": "Prometheus metrics",
104
+
"responses": {
105
+
"200": {
106
+
"description": "Prometheus exposition format",
107
+
"schema": {
108
+
"type": "string"
109
+
}
110
+
}
111
+
}
112
+
}
113
+
},
95
114
"/ws": {
96
115
"get": {
97
116
"description": "Upgrades HTTP to WebSocket. Pass a Firebase ID token as `?token=\u003ctoken\u003e`. Returns 401 when the token is missing or invalid.",
0 commit comments