EnvMap GitHub

When a dashboard cannot see, it must say so

An empty list on a dashboard means one of two things. Either there is nothing there, or the dashboard could not find out. The first is good news. The second is no news, dressed as good news. Telling them apart is most of what makes a dashboard worth trusting.

EnvMap reads a lot of other systems: Kubernetes clusters, Argo CD, Prometheus, Alertmanager, Grafana, CI servers, scanners, certificate stores, hypervisors, server hardware. Any of them can be slow, down, or refuse the credential it was given. Every page has to decide what to show when that happens.

The easy answer is to show what came back. When nothing came back, that is an empty list, and an empty list looks clean. This post is about the four times EnvMap shipped that easy answer, and the rule that replaced it.

1. A cluster that could not be read looked like a cluster with nothing expiring#

The Expiry radar collects every TLS certificate in every cluster and sorts them by when they run out. To find them it asks each cluster for its secrets of type TLS.

A read-only kubeconfig without permission to list secrets cluster-wide is an ordinary thing to be handed. kubectl answered Error from server (Forbidden), the function that ran it returned an empty string for any failure, and the parser read an empty string as "no certificates". That cluster then showed on the radar as having nothing to worry about.

The fix was to make the read return the error with the text, and to carry kubectl's own sentence to the page. "Forbidden" is the diagnosis. Hiding it hid the reason and the problem together.

2. An alert panel that said "nothing firing" about systems it could not reach#

The Overview can show a panel of firing alerts from every connected monitoring system. The first version asked each one in parallel and skipped any that returned nothing.

An unreachable Prometheus returned nothing. So a panel over three systems, none of which answered, said nothing firing, which is exactly what a person glancing at a wall screen wants to read, and exactly what was not known.

Now every system that did not answer is named on the panel as not answering, and when none answered the panel draws no counts at all. A zero is a measurement. It may only appear when something was measured.

3. Silenced alerts counted as firing, and firing alerts counted as silenced#

The same panel had a second problem: each platform words alert state differently. Prometheus says firing. Alertmanager and Grafana say active. Silenced alerts are suppressed, silenced or inhibited depending on who you ask.

One page treated anything that was not active as muted, so every firing Prometheus alert was counted as suppressed. Another counted Grafana's silenced alerts in the firing tiles. Both pages showed plausible numbers, and both were wrong.

The fix was one vocabulary, set in one place, that every platform's answer passes through before anything counts it. A page counts that one list, never the raw words.

4. A page that was as slow as the slowest thing it read#

This one looks like a performance bug, and it is the same bug.

On an estate of 24 clusters and 10 connections, with nothing cached yet, the GitOps page took 19.6 seconds to open. Server hardware took 16.1. The Overview took 10.4. Every one of those pages rendered in under 15 milliseconds once its data was in memory. The time was spent waiting for the one cluster that was not answering.

The obvious fix is a timeout. But a page that gives up after a timeout and shows what arrived has a new problem: a table of 8 clusters on an estate of 24, with nothing to explain the gap. That page lies faster than the old one.

So the fix has two halves:

Measured afterwards: the GitOps page in 0.45 seconds, hardware in 0.42, the Overview in 0.45, each saying out loud which clusters were still on their way.

The rule#

Out of those four came one rule, now written into how every page is built:

A system that did not answer shows a dash or an error, never a zero. A list that could not be read is an error, never an empty list. A page still waiting on a slow system says which one.

It sounds obvious. It was broken four times by code that was correct about everything it looked at. In each case the failure was invisible, because the wrong answer was the reassuring one.

Why this matters more for an operations tool#

A wrong number on a sales dashboard misleads a meeting. A wrong "nothing expiring" or "nothing firing" on an operations dashboard is the reason nobody looks, until the certificate expires or the alert becomes an outage.

So the question to ask of any dashboard, including EnvMap, is not "is it green" but "would it tell me if it could not see". Unplug one of its sources and look at the page.

Try it#

EnvMap is open source under Apache-2.0. The demo shows the real screens with pretend data, and it runs on one machine with Docker Compose:

bash
curl -fsSLO \
  https://raw.githubusercontent.com/ammar-hassoun/envmap/main/deploy/compose/compose.yaml
docker compose up -d

More on how it behaves: the security model, and the other post on this blog, how a privileged session recording is built.

EnvMap home · Docs · GitHub