ADR-0238: The estate overview is a digest of the scrape cache, filtered per caller
- Status: accepted; decisions 1 and 4 superseded by ADR-0245
- Date: 2026-12-02
- Deciders: Mahdi Amirabdollahi
- Change:
openspec/changes/39-estate-dashboard
Context
The Dashboard must say what needs attention across every broker, for one cluster or twenty, in one request, without calling a broker. Its inputs come from several modules:
- cluster health (ADR-0215), node reachability;
- subscription snapshots, the metric history, and triage's consumer verdicts (ADR-0089);
- firing alerts, held operations, and the audit trail.
Computing all of that on every request costs a few queries per cluster per viewer. Computing it once and sharing it risks serving one caller's view to another, because some of these reads are guarded by the current user.
Decision
- A digest per cluster.
feature.estatekeeps one digest per cluster, per replica, built from the scrape cache. It holds the rolled-up subscription rows, a one-hour rate series of messages added, triage's verdicts, the dead-letter destinations, the node reachability, and the health with its first cause.- It is kept for 15 s (tier B) and built single-flight.
- It is built with no security context, using only the unguarded reads the schedulers use.
- It never touches the broker gateway.
- Filtering per request. Each request filters the digests to the caller: the visible clusters, then the readable subscriptions and destinations in each. It sums the totals from what remains. To that it adds the caller's own signals: alert counts where the caller holds
alert:read, held operations the caller may decide, and recent changes from the audits the caller may read, in one query. - Everything is bounded and says when it was cut. The bounds are attention 50, top backlogs 10, stalled 10, recent changes 15 and clusters 200. A figure that cannot be read is null with a reason, and a total says exact or estimate.
- The page polls. It polls one endpoint every 15 s while visible, rather than adding an estate stream topic.
- Sparklines for partial readers. A cluster's sparkline is withheld from a caller who cannot read every subscription of that cluster, because the series cannot be filtered per queue.
Consequences
- The brokers never see the Dashboard.
- The database sees about five cache queries per cluster per 15 s per replica, whatever the number of viewers, plus three small queries per request.
- The figures can be up to 15 s behind the cache. A held operation can reach the Dashboard up to 15 s late; the inbox and the Approvals page stay live.
- New attention sources are added in
feature.estate. A plugin adds its own panel through theestate.dashboardslot.
Alternatives considered
- Compute everything per request. The cost grows with viewers times clusters.
- Build on the scrape-tier event. It runs synchronously on the scrape thread, so the build would slow the scrape and work when nobody is looking.
- A signal SPI each feature contributes to. There are four fixed sources today; the slot already extends the page.
- An estate SSE topic. Topics are per cluster, and a 15 s digest gains nothing from push.