See every Grafana alert rule firing or pending, grouped by folder

Every morning: Grafana alert rules that are firing or pending, grouped by folder, with how long each has fired and which are silenced.

Runs
Every day at 8:30
Uses
Grafana
Posts
Report card

What lands on your board

AcmeGrafana firing alerts digest · Claude Code

4 alert rules firing, the oldest for 3 days

4 rules are firing and 2 pending across 3 folders. Payments 5xx above 2% is new since yesterday; 1 rule cannot evaluate.

Firing 4Pending 2New 1Silenced 1Error 1
FolderRuleStateActive for
PaymentsPayments 5xx above 2% (service=checkout)Firing2 h, new
PlatformNode disk above 85% (instance=db-2)Firing3 days
PlatformCertificate expires in 14 days (api.example.com)Firing2 days, silenced
DataNightly ETL did not finishFiring5 h
PaymentsWebhook queue lag above 60 sPending4 min
PlatformPod restarts above 5 per hourPending2 min

Rule "Search latency p99" is in error: its Prometheus query references a metric that no longer exists.

Done
An example with made-up numbers. Your agent posts your real ones.

What it does

Grafana sends a notification when an alert starts firing, and then it goes quiet until it resolves. Alerts that fire for days, the ones everyone has learned to ignore, end up hiding the new one in the same channel.

The agent reads the current state of every Grafana-managed alert rule, groups the firing and pending ones by folder (usually one per team or service), sorts them by how long they have been active and marks the ones under a silence. The morning card is the list your team would see if it opened the Alert rules page and filtered by state.

How it works

  1. 1Read rule states

    With the Grafana MCP server (mcp-grafana, started with --disable-write), list_alert_rules returns every rule with its state and get_alert_rule_by_uid the detail. Over HTTP, GET <grafana>/api/prometheus/grafana/api/v1/rules (the endpoint the Alert rules page uses) returns groups with file (the folder), and rules with state, health and their active alerts.

  2. 2

    2Keep firing and pending

    Keep rules whose state is firing or pending, and rules with health error, which cannot evaluate at all. For each alert instance, firing time is now minus activeAt; show its key labels such as service or instance.

  3. 3Mark silences

    GET <grafana>/api/alertmanager/grafana/api/v2/silences and match active silences to the alert labels, so a silenced alert is shown as such instead of as a new problem.

  4. 4

    4Compare and report

    Compare with yesterday's list. Group by folder, firing before pending, longest first, and mark new ones. Rules in error get their own line, since a broken query means you have no alert at all.

  5. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

What you get

  • Counts: rules firing, pending, in error, and how many are new since yesterday.
  • By folder: each firing or pending rule with its labels and how long it has been active.
  • Silenced: alerts under a silence, with when the silence ends.
  • Broken rules: rules whose query errors.
  • One line on the alert to look at first.

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/grafana-firing-alerts-digest/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the grafana-firing-alerts-digest skill

    Or paste the prompt instead of installing:

    promptRead the current state of my Grafana-managed alert rules, using the Grafana MCP server in read-only mode or GET /api/prometheus/grafana/api/v1/rules with a Viewer service account token. List rules that are firing or pending, and rules whose health is error. Group them by folder, firing before pending, and for each give the rule name, key labels of the active alerts and how long since activeAt. Check active silences (GET /api/alertmanager/grafana/api/v2/silences) and mark silenced alerts with when the silence ends. If you have yesterday's list, mark what is new. End with the one alert to look at first. Do not create, edit or silence anything.
  3. Put it on a schedule

    Every day at 8:30, from cron on any machine where Claude Code is signed in:

    crontab30 8 * * * claude -p "Run the grafana-firing-alerts-digest skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a report card. How setup works

View the SKILL.mdRaw file
SKILL.md---
name: grafana-firing-alerts-digest
description: "Every morning: Grafana alert rules that are firing or pending, grouped by folder, with how long each has fired and which are silenced. Use when the user asks for this, or when it runs on a schedule."
---

# Grafana firing alerts digest

Every morning: Grafana alert rules that are firing or pending, grouped by folder, with how long each has fired and which are silenced.

Grafana sends a notification when an alert starts firing, and then it goes quiet until it resolves. Alerts that fire for days, the ones everyone has learned to ignore, end up hiding the new one in the same channel.

The agent reads the current state of every Grafana-managed alert rule, groups the firing and pending ones by folder (usually one per team or service), sorts them by how long they have been active and marks the ones under a silence. The morning card is the list your team would see if it opened the Alert rules page and filtered by state.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- A Grafana service account token with the Viewer role (enough to read alert rules and silences) in `GRAFANA_TOKEN`, and the Grafana URL.
- Or the Grafana MCP server (`mcp-grafana`) connected to the same instance.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **Read rule states** (Grafana): With the Grafana MCP server (`mcp-grafana`, started with `--disable-write`), `list_alert_rules` returns every rule with its state and `get_alert_rule_by_uid` the detail. Over HTTP, `GET <grafana>/api/prometheus/grafana/api/v1/rules` (the endpoint the Alert rules page uses) returns groups with `file` (the folder), and rules with `state`, `health` and their active `alerts`.
2. **Keep firing and pending**: Keep rules whose `state` is `firing` or `pending`, and rules with `health` `error`, which cannot evaluate at all. For each alert instance, firing time is now minus `activeAt`; show its key labels such as `service` or `instance`.
3. **Mark silences** (Grafana): `GET <grafana>/api/alertmanager/grafana/api/v2/silences` and match active silences to the alert labels, so a silenced alert is shown as such instead of as a new problem.
4. **Compare and report**: Compare with yesterday's list. Group by folder, firing before pending, longest first, and mark new ones. Rules in error get their own line, since a broken query means you have no alert at all.

## Route B: the browser

### What you need

- Signed in to the Grafana instance (or the Grafana Cloud stack) with at least the Viewer role on the folders that hold the rules; Viewer can read alert rules and silences.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://grafana.com/auth/sign-in/. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Open the Alert rules page**: For Grafana Cloud, sign in at grafana.com, open **My Account** and launch the stack; for a self-hosted Grafana, open your own URL. Then go to **Alerting** > **Alert rules** (the path is `/alerting/list`). Leave the **Grafana managed** section open and collapse data source managed rules unless you want them.
2. **Filter by state**: Use the **State** filter and pick `Firing`, read the list, then pick `Pending`. Rules are grouped by folder and evaluation group; expand a rule to see its alert instances, their labels and the **Active since** time, which gives how long it has fired.
3. **Find broken rules**: Set the **Health** filter to `Error` (or search `health:error`) to list rules that cannot evaluate; the rule row shows the error text. Clear the filters afterwards.
4. **Mark silences**: Open **Alerting** > **Silences**. Active silences list their matchers and end time; match them against the firing instances' labels and mark those alerts as silenced in the report.
5. **Compare and report**: Compare the rule names with yesterday's list to mark what is new. Group by folder, firing before pending, longest first, with silenced and errored rules called out and the one alert to look at first.

Note: The Alert rules page shows the state at load time, so refresh before reading. Instances of a multi-dimensional rule can run to hundreds of rows; the page paginates them per rule. Data source managed rules (Mimir, Loki, Prometheus) appear in their own section and are not part of this report unless you ask.

## The report

- **Counts**: rules firing, pending, in error, and how many are new since yesterday.
- **By folder**: each firing or pending rule with its labels and how long it has been active.
- **Silenced**: alerts under a silence, with when the silence ends.
- **Broken rules**: rules whose query errors.
- One line on the alert to look at first.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "grafana-firing-alerts-digest/<date of this run, e.g. 2026-10-16>",
  "item_key": "grafana-firing-alerts-digest",
  "project": "Acme",
  "source": "Grafana firing alerts digest skill",
  "kind": "update",
  "title": "4 alert rules firing, the oldest for 3 days",
  "summary": "**4** rules are firing and **2** pending across 3 folders. **Payments 5xx above 2%** is new since yesterday; **1** rule cannot evaluate.",
  "widget": [
    {
      "type": "Badges",
      "props": {
        "items": [
          {
            "label": "Firing 4",
            "tone": "bad"
          },
          {
            "label": "Pending 2",
            "tone": "warn"
          },
          {
            "label": "New 1",
            "tone": "bad"
          },
          {
            "label": "Silenced 1",
            "tone": "neutral"
          },
          {
            "label": "Error 1",
            "tone": "warn"
          }
        ]
      }
    },
    {
      "type": "Table",
      "props": {
        "columns": [
          "Folder",
          "Rule",
          "State",
          "Active for"
        ],
        "rows": [
          [
            "Payments",
            "Payments 5xx above 2% (service=checkout)",
            "Firing",
            "2 h, new"
          ],
          [
            "Platform",
            "Node disk above 85% (instance=db-2)",
            "Firing",
            "3 days"
          ],
          [
            "Platform",
            "Certificate expires in 14 days (api.example.com)",
            "Firing",
            "2 days, silenced"
          ],
          [
            "Data",
            "Nightly ETL did not finish",
            "Firing",
            "5 h"
          ],
          [
            "Payments",
            "Webhook queue lag above 60 s",
            "Pending",
            "4 min"
          ],
          [
            "Platform",
            "Pod restarts above 5 per hour",
            "Pending",
            "2 min"
          ]
        ]
      }
    },
    {
      "type": "Callout",
      "props": {
        "text": "Rule \"Search latency p99\" is in error: its Prometheus query references a metric that no longer exists.",
        "tone": "warn"
      }
    }
  ]
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

## Run it on a schedule

Suggested: Every day at 8:30 (`30 8 * * *`). From cron, with the agent signed in on that machine:

```bash
30 8 * * * claude -p "Run the grafana-firing-alerts-digest skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/grafana-firing-alerts-digest#schedule

Source: https://briefkin.dev/skills/grafana-firing-alerts-digest

What your agent needs

  • A Grafana service account token with the Viewer role (enough to read alert rules and silences) in GRAFANA_TOKEN, and the Grafana URL.

  • Or the Grafana MCP server (mcp-grafana) connected to the same instance.

Connecting Grafana

  1. Grafana MCP server (mcp-grafana), Grafana Labs' official open-source server. It runs locally with uvx mcp-grafana, the grafana/mcp-grafana Docker image or a release binary, and reads GRAFANA_URL (your instance, or https://myinstance.grafana.net on Grafana Cloud) and GRAFANA_SERVICE_ACCOUNT_TOKEN. In Claude Code: claude mcp add grafana -e GRAFANA_URL=... -e GRAFANA_SERVICE_ACCOUNT_TOKEN=... -- uvx mcp-grafana --disable-write; Cursor and Codex run the same command. It covers dashboards, Prometheus and Loki queries, alert rules and their states, OnCall and incidents (source).
  2. HTTP API with a service account token. Create a service account under Administration > Users and access > Service accounts with the Viewer role, add a token, store it in GRAFANA_SERVICE_ACCOUNT_TOKEN with GRAFANA_URL, and send it as a Bearer token.

--disable-write removes every tool that creates or changes dashboards, alert rules, silences or contact points; with a Viewer service account behind it, the agent can read alert states and run queries and nothing else.

Questions

Does it include alert rules managed in Prometheus or Mimir?

Not with the endpoint above, which covers Grafana-managed rules. Data source-managed rules have their own Prometheus-compatible endpoint per data source, /api/prometheus/<datasource uid>/api/v1/rules; name the data sources in the prompt and the agent will read those too.

Why does a rule show pending and not firing?

A rule stays pending while its condition is true but the pending period (the for duration) has not passed yet. Pending rules are shown so you see trouble starting, but they do not count as firing and do not turn the card red.

Do I need Briefkin to use the Grafana firing alerts digest skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a report card, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the Grafana pages themselves: the agent opens grafana.com/auth/sign-in in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Read this report on your board, not in a chat log

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.