All jobs

How Do I Send Each Client a Monthly Uptime Report From Grafana Synthetic Monitoring? A Website Care Company's Month-End Run

A website care company runs an agent at month end that reads each client's Grafana Synthetic Monitoring checks and drafts their uptime and outage report.

Run this on RushOpens the console with this prompt ready to send. Connect Grafana Cloud there first.

What the agent does

This is for a website care company that hosts and looks after the websites of forty small businesses: dental practices, law offices, restaurants, a few online shops. Its care plan promises to watch each site around the clock, and it does that with Grafana Cloud Synthetic Monitoring, one HTTP check per client site probing from several locations. At the start of each month every client gets a short report: the month's uptime, each outage with its start, end and cause, and anything the company fixed. Building each one from dashboards by hand is slow. The agent reads the numbers and drafts each report; an account manager adds the causes and sends them.

The operations lead connects Grafana once with POST /me/connections {"type": "mcp", "name": "grafana", "url": "https://mcp.grafana.com/mcp", "auth": {"mode": "oauth"}} and opens the authorize_url, signing in to the company's Grafana Cloud stack. The agent queries the Prometheus data source that holds Synthetic Monitoring's metrics, with the permissions of the person who signed in.

Grafana's docs define uptime as the percentage of time points in a period with at least one successful probe execution, and reachability as the percentage of probe executions that succeeded, and give the PromQL for each: uptime from probe_success with max_over_time over the check's frequency, and reachability from rate(probe_all_success_sum) divided by rate(probe_all_success_count), both filtered on the check's job and instance labels. For each client check named in the request, the agent runs both as range queries over the month with a one-minute step and averages them, the same expressions behind the uptime and reachability figures Grafana shows for a check.

From the uptime series it finds every run of consecutive minutes with no successful probe, and keeps those of five minutes or more as outages, with start and end times in the client's time zone. Grafana's docs list probe among the labels every check metric carries, so for each outage it also queries probe_success by probe, so the report can say whether every location failed or only one, which is often a network problem near that probe rather than the site. It writes one draft report per client and leaves a blank Cause line under each outage.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Draft October 2026 uptime reports from Grafana Synthetic Monitoring. Use the grafana connection. Find the Prometheus data source that holds probe_success. Checks (job, instance, client, time zone): (\"harbor-dental-home\", \"https://harbordental.example/\", Harbor Dental, America/New_York); (\"brightlaw-home\", \"https://brightlaw.example/\", Bright Law, America/Chicago); (\"tacoloco-order\", \"https://tacoloco.example/order\", Taco Loco, America/Los_Angeles). For each, over 2026-10-01T00:00 to 2026-11-01T00:00 in the client's time zone, with step 60s: uptime = max by () (max_over_time(probe_success{job, instance}[60s])), averaged; reachability = sum(rate(probe_all_success_sum{job, instance}[5m])) / sum(rate(probe_all_success_count{job, instance}[5m])), averaged. Outages: runs of 5 or more consecutive minutes where uptime is 0; for each, query probe_success by probe for that window and list which probes failed. Write one file per client, uptime-<job>.md: month, uptime % to 3 decimals, reachability % to 3 decimals, a table of outages (start, end, minutes, probes failing, all or some), and under each outage the line 'Cause: '. Write summary.md with one row per client. Read only: never create or change dashboards, alert rules, annotations or incidents.",
  "connections": [
    "grafana"
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

The run writes an uptime report for each client for the month, and a summary.md that marks any client below the care plan's usual figure. Each report is an uptime-<job>.md file, and the session lists them all as artifacts. The account manager opens the summary first, then fills each Cause line from the support tickets and the hosting provider's status page, and pastes the report into the monthly email or the client's PDF.

What the account manager checks: an outage where only one probe location failed, which the report marks as some, and which the company may choose to leave out of the client's figure with an explanation; planned maintenance the company announced, which the probes record as downtime; and the check's frequency, since a check that runs every five minutes cannot see a two-minute outage. The figures are Grafana's measurements of the check, not a statement about the client's whole site.

Run it on every first day of the month

In the console, a Project automation with a schedule trigger at 0 6 1 * * in the company's timezone runs a saved agent whose connections name grafana, with the client checks in its instructions. A schedule fills no dates into the prompt, so the instructions say "the previous calendar month" and each report states the month at the top.

A company that signs a new client in the middle of the month adds its check to the saved agent's list; the next month's run includes it, and the report for that first partial month says from which day the check ran.

The use case this job follows, with its automation and trigger: Produce a report or file, no repo.

Why run it on Rush?

The Grafana sign-in stays in Rush's connection rather than in a service account token on an engineer's laptop, and the agent reads with that person's permissions. Each run has its own computer and a record of every query it ran, so when a client disputes an outage, the company can open that month's session and see the exact PromQL and time window behind the number.

Forty clients is forty sets of the same queries, which is slow by hand and quick for a run that does not have to click through dashboards. The session records its total_cost_usd, so the company can see what the month-end reports cost against the care plan fee.

Frequently asked questions

Why do the figures sometimes differ from the dashboard's?

The request uses the expressions Grafana's docs give for uptime and reachability, with a one-minute step. A dashboard viewed at a coarser interval, or a check whose frequency is not one minute, can round differently; the request should use each check's own frequency for the uptime window.

Can the agent explain why each outage happened?

Not from synthetic checks alone: they record that the site did not answer, not why. The report leaves a Cause line for the account manager, who knows whether it was a host incident, a plugin update or the client's own DNS change.

Does this calculate credits under the care plan?

No. It reports measured uptime. Whether a figure triggers a credit depends on the contract's wording, which a person applies.

More Grafana Cloud jobs

More jobs like this: Produce a report or file, no repo

Keep reading