fabbr@site:~/projects/magellan/grafana$

grafana

# ~/projects/magellan/grafana.yml
grafana:
  status: active
  started: 2026-09-29
  tags: [grafana, infinity, ansible]

magellan-cloud stores readings and answers queries but has no UI of its own, so Grafana is the client that reads them back. It runs on the VM from infra, holds a read-only client token of its own, and reads the api-worker over HTTPS through Infinity, a generic JSON datasource, with nothing in between to build or keep running. Being the client, it’s where the meaning of the data is defined: the cloud never names an inverter, so units, labels, thresholds and a dashboard for the inverter itself all live here.

devices, metricsseries, latest,healthhealthAPI workerdevice andmetric menusdashboardpanelssilent alert

Mostly I open it because I’m building the damn thing. Jokes aside, I read it from time to time to see whether the project is stable and healthy, and to check the solar generation. Since 2026-10-08 it does at least what the inverter’s own app does, and since magellan-device buffers through an internet drop, it has the detail that app loses.

What it shows

Three dashboards, each reading the API as it is:

  • Device: how long since magellan-device last reported, gaps in its sequence over the last day, uptime, buffer depth, and when each source was last read.
  • Metrics: a series and the latest values for any metric of any source. A new device or source appears in its menus without touching the dashboard.
  • Inverter: energy today and in total, power, the inverter’s state, energy by day or by month, and grid readings and temperatures.

Grafana passes the time range to the api-worker as query parameters, and the api-worker picks how coarse to answer: raw readings up to 2 days, hourly rollups up to 90 days, daily past that. Monthly energy is the daily rollup summed in Grafana.

What it watches

There is one alert per device. If neither a batch nor a heartbeat arrives for 75 minutes, the device is down or cut off. The hourly heartbeat is what makes that safe at night, when the sun window stops polling and the binary still checks in. The rule is provisioned and evaluated, but I never finished wiring a notification channel, so I’ve never seen it fire.

How it got here

The first dashboard, on 2026-09-30, was a single device view. On 2026-10-08 it split into the three above, each filling its menus from the API: the Metrics dashboard lists whatever a device’s manifest declares, and the Inverter dashboard finds the inverter by the energy metric declared for it, so neither needs a source written in by hand.

Decisions

  • Its client token is revocable apart from every device’s, and the cloud holds no record of Grafana beyond it.
  • The datasource, dashboards and alert rules are files in magellan-infra, and edits in the UI are refused, so a rebuilt VM comes back with the same dashboards.
  • Each device in the inventory gets its alert rule, so a new device is watched from the next converge.

The dashboards could still change shape. As its user I change my mind, as users always do, and Grafana is the one piece besides magellan-infra that has to know the whole project, the cloud’s contract and what each metric means, so reshaping it stays cheap.