Kuadrant / Kuadrant/kuadrant-console-plugin
AuthPolicy View: Metrics Tab with Perses Panels
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 65
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 44
Description
## Context
Add a Metrics tab to the AuthPolicy details page showing auth decision metrics using embedded Perses panels. This answers: "Is my auth policy working? Are requests being denied? Is auth adding latency?"
Depends on the shared Perses infrastructure established in #220.
## Requirements
### New Metrics tab
Add a `console.tab/horizontalNav` on `AuthPolicy` (`kuadrant.io/v1`):
- Tab name: "Metrics"
- Tab href: `metrics`
**Panels:**
| Panel | Metric | Panel Type |
|-------|--------|-----------|
| Auth Decisions Over Time | `sum(rate(auth_server_authconfig_response_status{authconfig="", namespace=""}[5m])) by (status)` | TimeSeriesChart stacked (OK / UNAUTHENTICATED / PERMISSION_DENIED) |
| Auth Latency | `histogram_quantile(0.50, rate(auth_server_authconfig_duration_seconds_bucket{authconfig="", namespace=""}[5m]))` (repeat for p95, p99) | TimeSeriesChart (3 lines: p50, p95, p99) |
| Total Evaluations | `sum(rate(auth_server_authconfig_total{authconfig="", namespace=""}[5m]))` | StatChart (evaluations/s) |
**Controls:**
- Time range selector: 15m, 1h, 6h, 24h, 7d (default: 1h)
### AuthConfig name mapping
The `authconfig` label in Authorino metrics corresponds to the AuthConfig resource that Authorino creates from the AuthPolicy. The naming convention needs to be verified — typically the AuthConfig name matches the AuthPolicy name in the same namespace.
### Empty states
- No auth data: "No auth metrics available. Metrics will appear once requests are evaluated by this policy."
- Authorino metrics not available: "Auth metrics require Authorino to be configured with metrics enabled."
- Prometheus unavailable: shared `EmptyMetricsState` component from #220
Contributor guide
Research direction
Start by reviewing the shared Perses infrastructure established in #220 and the AuthPolicy details page. Verify the AuthConfig naming convention, then implement the Metrics tab with the listed panels, time controls, and empty states; it is done when AuthPolicy metrics render correctly or show the specified fallback messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100