What the agent does
This is for a cold-storage warehouse that stores frozen and chilled food for its customers: a few blast freezers, several holding freezers kept well below zero, a chilled dock and a cooler for produce. Each room has wireless temperature probes, and a gateway sends their readings to the Prometheus data source in the warehouse's Grafana Cloud stack, where a wall dashboard shows every room. Alert rules page the on-call engineer when a room stays warm for too long. What nobody has at the start of the morning shift is a short written account of the night: which rooms left their range, for how long, how warm they got, and which probes stopped reporting so their rooms were never watched at all. A night shift that was busy loading trucks rarely writes that down. An agent writes it at 6:00 every morning.
The operations manager connects Grafana Cloud once with POST /me/connections {"type": "mcp", "name": "grafana", "url": "https://mcp.grafana.com/mcp", "auth": {"mode": "oauth"}}, opens the authorize_url while signed in to the Rush console and enters the stack's URL on Grafana's page. Grafana's consent page has separate boxes for read, query and write access. The manager leaves only Read access ticked: Grafana's docs say that with read access alone an agent can browse dashboards and query Prometheus and Loki, while the SQL tools and every tool that creates or changes a dashboard, alert rule or incident stay unavailable. The agent acts with the manager's own Grafana permissions.
On a run the agent calls list_prometheus_metric_names with a pattern such as temperature to find the probe metric the gateway writes, and list_prometheus_label_values to list the rooms and probe ids on it. It then calls query_prometheus as a range query over the night, from 18:00 to 06:00 in the warehouse's time zone, at a one-minute step, once per room. For each room it compares the readings with that room's range from the prompt, and works out every stretch above the upper limit: when it started, when it ended, the warmest reading and the minutes spent out of range. A probe whose series stops for more than 15 minutes is listed as silent, with the time of its last reading.
Then it puts each excursion in context. alerting_manage_rules lists the temperature rules and their state, so the report says whether an alert fired during the excursion or whether the room drifted warm under the rule's threshold and nobody was paged. get_annotations for the night shows the notes people add on the dashboard, such as a defrost cycle, a door left open during a load or a compressor repair, and the agent sets each one beside the excursion it overlaps. generate_deeplink gives a link to the room's panel for the night, so the shift lead opens the graph instead of searching for it.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Overnight temperature check for the warehouse. Night: 2026-11-22 18:00 to 2026-11-23 06:00, time zone America/Chicago. Use the grafana connection, read only. Rooms and allowed ranges in Celsius: BF-1 and BF-2 (blast freezers) -35 to -18; HF-1, HF-2, HF-3 (holding freezers) -28 to -18; CD-1 (chilled dock) 0 to 5; PC-1 (produce cooler) 1 to 4. 1) list_prometheus_metric_names with the regex temperature; pick the probe temperature metric and use list_prometheus_label_values for its room and probe labels. 2) For each room, query_prometheus as a range query over the night with a 60s step, per probe. 3) Excursion: consecutive readings above the room's upper limit (or below the lower limit for CD-1 and PC-1) lasting 5 minutes or more; record start, end, minutes, warmest or coldest reading and probe. Silent probe: no sample for 15 minutes or more; record last reading time. 4) alerting_manage_rules: list temperature rules and their state; say for each excursion whether a rule fired. 5) get_annotations for the night; attach any annotation overlapping an excursion. 6) generate_deeplink to each affected room's panel for the night. Write overnight.md: rooms with excursions first (longest first), then silent probes, then rooms that stayed in range in one line. Do not create, change or silence anything in Grafana, and do not say whether any product is safe to ship.",
"connections": [
"grafana"
]
}- 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.
- 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.
- 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
overnight.md names each freezer room that ran warm overnight, with minutes out of range, the warmest reading and whether an alert fired. It comes among the session's files, with the same summary in the session's result. Each room that left its range also gets the times, the probe that saw the warmest reading, any annotation that explains it, and the link to the graph. Silent probes follow, then a single line naming the rooms that stayed in range all night.
The shift lead reads it before the first trucks arrive. What a person checks: that a long excursion is real and not one faulty probe, by opening the link and comparing the room's other probes; whether stock in that room needs to be held for the quality team under the warehouse's own procedure; and that every silent probe is fixed before the next night. The agent reports readings and times; what happens to the product is the quality team's decision, not the agent's.
Run it on every morning at 6:00
In the console, a Project automation with a schedule trigger, cron 0 6 * * * and timezone America/Chicago, runs a saved agent whose connections name grafana and whose instructions hold the room list and ranges. A schedule fills in no date, so the instructions say "from 18:00 yesterday to 06:00 today" and the agent works out the night on each run.
When a compressor fails during the day, the operations manager can start the same saved agent from the console with a different window, such as "since 10:00 today", and read the same report for that stretch.
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 lives in Rush's connection and acts as the operations manager, with only the read access ticked on Grafana's consent page, so the agent can read every room's temperatures and cannot change a threshold or silence a rule. No service account token sits in a script on the dashboard PC.
Each morning's run has its own computer and a record of every query it sent and every answer it got back, so when a customer asks about a pallet stored in HF-2 last Tuesday, the operations manager opens that morning's session and finds the exact series the report was built from. The session's total_cost_usd shows what each morning's check cost.
Frequently asked questions
Does the agent replace our temperature alerts?
No. Alert rules page someone while a room is warm; this report comes after the night is over. Its use is the stretches that never crossed an alert threshold, the probes that went quiet, and a written record the shift lead can keep.
Will Grafana ask us to sign in again?
Grafana's docs say the connection's token refreshes for 30 days and then asks you to authorize again. When that happens, connect Grafana again in Rush with the same request; reconnecting keeps the connection's id, so the saved agent keeps working.
Does connecting Grafana this way cost anything on the Grafana side?
Grafana's docs say the Cloud MCP server is part of Grafana Assistant: each person who connects counts as an active Assistant user, and tools used with read access do not spend Assistant tokens. Check your plan's Assistant terms before connecting.
Our probes report in Fahrenheit. Does that matter?
Write the room ranges in the unit the probe metric uses. The agent compares readings with the numbers in the prompt and does not convert units unless the instructions ask it to.
More Grafana jobs
More jobs like this: Produce a report or file, no repo
- Which Guest Complaints From Yesterday Got No Reply From a Manager? A Hotel Group's Morning Sweep of Its Slack Property Channels (Slack)
- Which Railway Projects Are Still Running for Clients We No Longer Serve? A Web Agency's Monthly Hosting Check (Railway)
- How to Fix Keyword Cannibalization With Semrush (Semrush)