diff options
| author | bndw <ben@bdw.to> | 2026-02-15 10:31:06 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-15 10:31:06 -0800 |
| commit | f658ef072394ff9fd28244ad475859c210e8ec16 (patch) | |
| tree | cc08f5f3e09a1a75dd307a1439f53c5e6a27d0ac /internal/metrics/dashboard.html | |
| parent | 57bc300fe26812aad568c8119f04d92e94c9ab14 (diff) | |
feat: track authorized (authenticated + successful) requests
Add 'authorized' status for requests that complete successfully after
authentication. This complements the existing 'unauthenticated' (pre-auth)
status tracking.
Now the dashboard shows:
- Authorized: Authenticated requests that succeeded
- Unauthorized: Authenticated requests rejected (not in allowlist)
- Pre-Auth: Requests sent before authentication
This gives full visibility into the auth flow:
1. Challenges: How many clients authenticated
2. Authorized: How many authenticated requests succeeded
3. Unauthorized: How many were rejected despite valid auth
4. Pre-Auth: How many tried before authenticating
Updated metrics:
- requests_total{status="authorized"} - authenticated successes
- requests_total{status="ok"} - unauthenticated successes (when no auth)
Diffstat (limited to 'internal/metrics/dashboard.html')
| -rw-r--r-- | internal/metrics/dashboard.html | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/metrics/dashboard.html b/internal/metrics/dashboard.html index ab08eab..b7be1d7 100644 --- a/internal/metrics/dashboard.html +++ b/internal/metrics/dashboard.html | |||
| @@ -172,6 +172,10 @@ | |||
| 172 | <span class="metric-value" id="auth_success">0</span> | 172 | <span class="metric-value" id="auth_success">0</span> |
| 173 | </div> | 173 | </div> |
| 174 | <div class="metric"> | 174 | <div class="metric"> |
| 175 | <span class="metric-label">Authorized</span> | ||
| 176 | <span class="metric-value" id="auth_authorized">0</span> | ||
| 177 | </div> | ||
| 178 | <div class="metric"> | ||
| 175 | <span class="metric-label">Unauthorized</span> | 179 | <span class="metric-label">Unauthorized</span> |
| 176 | <span class="metric-value" id="auth_unauthorized">0</span> | 180 | <span class="metric-value" id="auth_unauthorized">0</span> |
| 177 | </div> | 181 | </div> |
| @@ -309,6 +313,9 @@ | |||
| 309 | document.getElementById('auth_success').textContent = | 313 | document.getElementById('auth_success').textContent = |
| 310 | getMetricByLabel(metrics, `${prefix}_relay_auth_attempts_total`, 'result', 'success'); | 314 | getMetricByLabel(metrics, `${prefix}_relay_auth_attempts_total`, 'result', 'success'); |
| 311 | 315 | ||
| 316 | document.getElementById('auth_authorized').textContent = | ||
| 317 | getMetricByLabel(metrics, `${prefix}_relay_requests_total`, 'status', 'authorized'); | ||
| 318 | |||
| 312 | document.getElementById('auth_unauthorized').textContent = | 319 | document.getElementById('auth_unauthorized').textContent = |
| 313 | getMetricByLabel(metrics, `${prefix}_relay_requests_total`, 'status', 'unauthorized'); | 320 | getMetricByLabel(metrics, `${prefix}_relay_requests_total`, 'status', 'unauthorized'); |
| 314 | 321 | ||
