Kuadrant / Kuadrant/kuadrant-console-plugin

DNSPolicy View: Metrics Tab with Perses Panels

Open
#683 0 comments 0 reactions 0 assignees View on GitHub
triage/accepted
Dominant language
TypeScript
Stars
10
Forks
65
Avg merge
2d 8h
Merged PRs (30d)
44

Description

## Context

Add a Metrics tab to the DNSPolicy details page showing DNS record health and provider metrics using embedded Perses panels. This answers: "Are my DNS records healthy? Are DNS provider operations succeeding?"

Depends on the shared Perses infrastructure established in #220.

## Requirements

### New Metrics tab

Add a `console.tab/horizontalNav` on `DNSPolicy` (`kuadrant.io/v1`):
- Tab name: "Metrics"
- Tab href: `metrics`

**Panels:**

| Panel | Metric | Panel Type |
|-------|--------|-----------|
| DNS Record Ready State | `dns_provider_record_ready{dns_record_namespace=""}` | StatChart (ready/not ready per record) |
| Provider Write Operations | `dns_provider_write_counter{dns_record_namespace=""}` | TimeSeriesChart |
| Provider API Latency | `histogram_quantile(0.50, rate(http_client_request_latency_seconds_bucket{client=""}[5m]))` (repeat for p95, p99) | TimeSeriesChart (3 lines: p50, p95, p99) |
| Provider API Errors | `sum(rate(http_client_requests_total{client="", code=~"[45].."}[5m])) by (code)` | TimeSeriesChart stacked |
| Health Probes Active | `dns_health_probe_counter{dns_health_check_namespace=""}` | StatChart |
| Policy Ready | `kuadrant_dns_policy_ready{dns_policy_name="", dns_policy_namespace="", dns_policy_condition="true"}` | StatChart |

**Controls:**
- Time range selector: 15m, 1h, 6h, 24h, 7d (default: 1h)

### DNS record scoping

DNSPolicy creates DNSRecord resources. The `dns_provider_record_ready` and `dns_provider_write_counter` metrics use `dns_record_name` and `dns_record_namespace` labels. The mapping from DNSPolicy to its owned DNSRecord resources needs to be resolved to scope the metrics correctly.

### Empty states
- No DNS data: "No DNS metrics available. Metrics will appear once DNS records are managed by this policy."
- Prometheus unavailable: shared `EmptyMetricsState` component from #220

## Notes
- Requires React 18 upgrade (OCP 4.22+ only)
- DNS operator metrics come from port 8080 `/metrics`; ensure Prometheus is scraping the dns-operator

Contributor guide

Open the contributing guide

Research direction

Start with the DNSPolicy console.tab/horizontalNav entry and the shared Perses infrastructure established in #220, including EmptyMetricsState. Resolve how DNSPolicy-owned DNSRecord resources provide metric labels, then verify the Metrics tab, six panels, time-range controls, empty states, and Prometheus scraping requirements against the listed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.