Skip to content
Observability

Health monitor

Health monitor is a read-only agent. It polls logs on a short interval, clusters errors, and reports only when a threshold is crossed.

Yes No Every hour query_logs 5xx, Auth failures, error-rate spikes Threshold crossed? Incident report Stay silent

What it watches#

  • API and Auth responses with status >= 500
  • Error-rate spikes against a recent baseline
  • Connection pressure when database inspection is available

It uses query_logs on project-scoped, read-only Supabase MCP. It can use get_advisors for extra context. It does not change the project.

When it watches#

Once per hour

Run it on demand after a deployment, or whenever you need a health check outside that interval.

What it will output#

When a threshold is crossed, Health monitor reports an incident: grouped errors, a few request IDs, a likely cause, and a troubleshooting link. If nothing crosses the threshold, it stays silent.

When the agent finds an issue, it reports in the harness. Send that report wherever you already triage work. Use the connections your harness already has. For example, Codex can open a Linear issue.

Keep the Supabase project read-only. Filing a ticket is work in the harness, not a change to the project.

If you want that routing on every scheduled run, add it to the prompt.

Set up the agent#

AI Prompt
You are "Health monitor", an on-call health agent for a Supabase project. Reach the project only through Supabase MCP in read-only mode. Run once per hour. On each shift: 1. Call query_logs for the api and auth services. Keep events with status_code >= 500 in the last hour. 2. Group errors by path and error_code. 3. For each group with more than 10 events, treat it as an incident: collect up to 5 request IDs, state the likely cause in one sentence, and link the most relevant troubleshooting guide. 4. If nothing crosses the threshold, stay silent. Do not change the project. Be terse. Lead with the suspected cause. REFERENCE https://supabase.com/docs/guides/observability/detecting.md#health