What you’ll see
Grafana alerts
- Health, in Details: how many alerts are firing, pending and silenced. It turns red while a firing alert’s
severitylabel iscritical,crit,high,page,error,emergency,alert,fatal,p1orsev1, in any case. It turns orange while any other alert is firing or a rule can’t be evaluated. Grafana has no severity of its own, so an alert with noseveritylabel counts as orange. The health card takes its colour, and a change sends a notification. - Firing: each firing alert, critical first and then newest first. A row names the rule, where it’s firing (its
instance,service,job,hostorpodlabel) with its summary, and how long it has been firing. A rule that can’t be evaluated shows here too, with Grafana’s error. Seven show at once, with Show N more. - Pending: alerts whose condition is true but haven’t waited out their pending period yet.
- Silenced: firing alerts that a silence in Grafana is holding back.
- Grafana: how many rules there are and how many can’t be evaluated, how many silences are active and when the next one ends, and Grafana’s version.
- Recent changes: the last four times an alert started firing or resolved, from Grafana’s state history.
Alert rule
What a row opens.
- Now: whether the rule is firing, and on how many of its instances, pending, silenced, paused or failing to evaluate. With an Editor token, its corner has Silence, a menu of 1 hour, 4 hours, 1 day and 1 week, or End silence while a silence made that way holds it. With https, a click opens the rule in Grafana.
- Instances: each series the rule watches, firing first, with its state and since when.
- Rule: its summary, folder and group, how often it’s evaluated and its pending period, its
severitylabel, and when Grafana last evaluated it. - State changes: its last four changes.
Status
- Watches every alert rule the token can see.
- Red while an alert labelled critical (or a word like it, such as high, page or p1) is firing, orange while any other alert is firing or a rule can’t be evaluated.
- Pending and silenced alerts never count as a problem.
- Red once Grafana stops answering.
- Shows in Details and notifies you when it turns orange or red.
How it connects
The pages read Grafana’s alerting API with a service account token, sent as Authorization: Bearer. A self-hosted Grafana and Grafana Cloud answer the same way.
Requests it makes on its own 8
- GET
/api/prometheus/grafana/api/v1/rules?state=firing &state=pending &state=recovering The rules that are firing, pending or recovering, with their alerts, and how many rules there are.
Every minute
- GET
/api/prometheus/grafana/api/v1/rules?health=error &health=nodata Rules that can’t be evaluated.
Every minute
- GET
/api/alertmanager/grafana/api/v2/alertsEvery firing alert in Grafana’s own Alertmanager, and whether a silence holds it.
Every minute
- GET
/api/alertmanager/grafana/api/v2/silencesActive silences and when they end.
Every minute
- GET
/api/annotations?type=alert Recent state changes.
Every minute
- GET
/api/healthGrafana’s version.
Every minute
GET /api/prometheus/grafana/api/v1/rules?rule_uid=…and the requests above for one ruleThe rule, its instances, silences and changes.
Every minute, while a rule’s page is open
- GET
/api/access-control/user/permissionsWhether the token may silence, so Silence shows only when it can.
Every minute, while a rule’s page is open
Requests it makes when you act 2
- POST
/api/alertmanager/grafana/api/v2/silencesA silence on the rule, from now until then.
When you pick a length from Silence
- DELETE
/api/alertmanager/grafana/api/v2/silence/{id}Ends that silence.
When you press End silence
The overview makes six small requests a minute, and a rule’s page five more while it’s open. Grafana’s alerting API documentation describes the rules, silences and roles.
Which token. A service account with the Viewer role can read every rule in the folders it can view, and that’s all the pages need. An Editor service account can also make and end silences, so Silence appears on a rule’s page. An Editor token can change rules and dashboards through the API too; the pages only read, silence and end silences.
Sources and buttons explains each part of a page.
Set it up
- Make a token. In Grafana, open Administration → Users and access → Service accounts, add a service account with the Viewer role (or Editor, to silence from Legato), and add a token to it. Grafana shows the token only once.
- Save it in Legato. In Settings → Secrets, save the token under
grafana, bound to your Grafana’s address. You can also link a 1Password reference. - Add the pages. Paste the prompt into your agent, or download both pages and run
/Applications/Legato.app/Contents/Helpers/legato set grafana grafana.json, then the same forgrafana-rule. - Point them at your Grafana. Change
http://grafana.local:3000to its address, with its port, on every source of both pages and in each page’ssitevalue:https://example.grafana.netfor Grafana Cloud. If you reach it over https with a self-signed certificate, use its IP address or a.localname, which Legato can trust. A Grafana served under a path, such ashttps://example.com/grafana, needs that path as each source’sbase.
The rows fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Grafana refused it.
Prompt for your agent
Add 2 Legato pages for Grafana alerts, starting from https://legatobar.com/examples/grafana.json, https://legatobar.com/examples/grafana-rule.json. Use the page IDs grafana, grafana-rule if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.
Add both pages as they are. Set the url of every source on both pages to my Grafana’s address, and the same address in each page’s site value. I’ll save a service account token as grafana in Settings → Secrets myself.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.Download the pages
Questions
What does Silence do?
The same as a silence you make in Grafana: it holds back the rule’s notifications, for every one of its instances, until the time you picked. It goes in Grafana’s own Alertmanager, made by “Legato”. While it holds, the rule’s page offers End silence. A silence you made in Grafana some other way, such as on a label, shows as Silenced but can only be ended in Grafana. Silence is only on a rule’s page, so Spotlight and Shortcuts don’t offer it.
Why does a firing alert show when Grafana sends alerts elsewhere?
While Grafana’s own Alertmanager holds alerts, the pages read what’s firing and what’s silenced from it. When it holds none, because Grafana sends its alerts only to another Alertmanager, they read what’s firing from the rules instead, which fire whichever way the alerts are sent. Silences made in that other Alertmanager don’t show, and the alerts they hold read as firing. Pending alerts always come from the rules. One gap: when a rule that already has an alert in Grafana’s Alertmanager starts firing on another instance, that instance can be missing for up to one evaluation, until Grafana passes it on.
Which rules does it show?
The rules Grafana manages, in the folders the token’s service account can view. Rules kept in a Prometheus, Mimir or Loki ruler (data-source-managed rules, common on Grafana Cloud) aren’t included yet.
What about older Grafana?
The pages need Grafana 12.0 or later: Grafana 11 refuses the request for recovering alerts, so the overview can’t load. Two filters arrived later and are ignored before then. Before 12.2 the check for rules that can’t be evaluated reads every rule, and before 12.4 a rule’s page reads every rule and keeps the one it’s about. Both still work, but a big server sends more each minute, and past about 700 rules that answer is more than the 1 MB Legato reads, so those cards can’t load.