PlanetScale webhooks: failed backups, storage and out-of-memory events as signals
Send a PlanetScale database's webhooks to Pulso and turn failed or missing backups, storage thresholds, out-of-memory restarts and schema recommendations into signals.
PlanetScale sends webhooks about a database’s life: backups, storage thresholds, out-of-memory restarts, maintenance, deploy requests and schema recommendations. It names the event in the body, so one Pulso webhook source can take every database’s events and each monitor picks its own.
Connect PlanetScale#
Add PlanetScale to Pulso to create a webhook source called PlanetScale; it shows these steps with the source’s URL and secret, then creates the monitors below that you pick, with their playbooks and a report. To start from scratch instead, create a webhook data source called PlanetScale.
- In PlanetScale, select the database, then Settings > Webhooks and click Add webhook. It takes a database administrator.
- Paste the source’s Endpoint URL,
https://hooks.pulso.run/webhooks/<id>/<token>. - Paste
Bearer <secret>as Authorization header. The secret is the source’s Signing secret, under Signatures with the Bearer token scheme: Add to Pulso makes one up and refuses deliveries without it; from scratch, set a long random one there. - Select the events the monitors below read,
backup.failed,backup.succeeded,cluster.storage,branch.out_of_memoryandbranch.schema_recommendation, and click Save webhook. - From the webhook’s … menu, click Test webhook. A
webhook.testevent shows up under the source’s Recent events.
Webhooks belong to a database, so repeat this for each database, all pointing at the same source. The CLI creates one with pscale webhook create <database> --events "backup.failed,backup.succeeded,cluster.storage,branch.out_of_memory,branch.schema_recommendation" --url <Pulso URL> --authorization-header "Bearer <secret>", disabled until you enable it with pscale webhook update; the API, with POST /organizations/{organization}/databases/{database}/webhooks and "enabled": true.
What arrives#
This is PlanetScale’s example of a backup.failed event, trimmed:
{
"timestamp": 1698252879,
"event": "backup.failed",
"organization": "myorg",
"database": "example_database",
"resource": {
"id": "k2n8pqw4x1yz",
"type": "Backup",
"name": "2026.08.27 15:04:05.123",
"state": "failed",
"size": 0,
"started_at": "2026-08-27T15:04:06.001Z",
"completed_at": "2026-08-27T15:12:44.890Z",
"restored_branches": [],
"actor": null,
"backup_policy": {
"id": "p0licy12abcd",
"name": "production",
"frequency_value": 12,
"frequency_unit": "hour"
},
"database_branch": {
"id": "q9x7ylb3hcmx",
"type": "Branch",
"name": "main"
}
}
}
Its monitors see these columns:
| Column | Value |
|---|---|
timestamp |
1698252879 |
event |
backup.failed |
organization |
myorg |
database |
example_database |
resource.id |
k2n8pqw4x1yz |
resource.name |
2026.08.27 15:04:05.123 |
resource.state |
failed |
resource.started_at |
2026-08-27T15:04:06.001Z |
resource.restored_branches |
[], the whole list in one column |
resource.actor |
null |
resource.backup_policy.name |
production |
resource.backup_policy.frequency_value |
12 |
resource.backup_policy.frequency_unit |
hour |
resource.database_branch.name |
main |
Every event has timestamp, event, organization, database and a resource shaped like the API’s answer for that object.
Monitors to build#
Failed backups#
- Filters:
eventequalsbackup.failed. - Uniq by:
resource.id. - Playbook: a task to check the backup in PlanetScale and start one by hand, with
{{signal.database}},{{signal.resource.database_branch.name}}and{{signal.resource.backup_policy.name}}in its text. Add a notification to whoever is on call.
Heartbeat: a backup that never finished#
A backup that hangs sends neither backup.succeeded nor backup.failed. A heartbeat monitor with the filter event equals backup.succeeded, Frequency custom at the backup policy’s schedule, such as 0 */12 * * * in UTC, and a grace period longer than a backup takes, an hour, raises a signal when one is missing. With several databases, give each its own, adding database equals that database and resource.database_branch.name equals main: one backup would otherwise stand in for all of them.
Storage running out#
- Filters:
eventequalscluster.storage(Postgres;keyspace.storageon Vitess with Metal),resource.storage_percentagegreater than84, so the 85%, 90% and 95% thresholds count and 60% and 75% don’t. - Uniq by:
databaseandtimestamp, so each crossing is a signal and a repeated delivery isn’t. - Playbook: a question, “Resize or clean up?”, with
{{signal.database}}and{{signal.resource.branch_name}}, and a task for whichever was chosen.
Out-of-memory restarts#
- Filters:
eventequalsbranch.out_of_memory(Postgres). - Uniq by:
databaseandtimestamp. PlanetScale sends this at most once every 30 minutes while the database keeps running out of memory. - Playbook: a task to find the query in Insights and check that the app retried what was rolled back, since active connections were dropped and open transactions rolled back. Add a Slack notification to tell the team.
Schema recommendations#
- Filters:
eventequalsbranch.schema_recommendation. - Uniq by:
resource.id. - Playbook: a question, “Apply or dismiss?”, with
{{signal.resource.ddl_statement}}and{{signal.resource.html_url}}, so each recommendation gets a decision, and a task for whichever was chosen.
Limits#
- Signatures. PlanetScale also signs each delivery in
X-PlanetScale-Signature, with a secret it makes up and shows once. The Authorization header is simpler to set up, as Pulso makes up the secret; to check the signature instead, a custom script of one line does it. - Two seconds. PlanetScale fails a delivery that takes longer than two seconds and doesn’t follow redirects. Pulso answers as soon as it stores the event; use the URL exactly as Pulso shows it.
- Failing webhooks get disabled. A webhook that fails repeatedly is disabled, and its last result shows on the Webhooks page. A heartbeat monitor is how you notice events stopped.
- Limits per database. Up to five webhooks per database, and one test every 20 seconds.
- Lists stay whole. The per-volume figures of
cluster.storageare inresource.storage, a list in one column; filter onresource.storage_percentageinstead.
Sources: PlanetScale’s webhooks and webhook events docs, the pscale webhook command and the create a webhook API.
Add PlanetScale to Pulso: a webhook source, 5 monitors with their playbooks and a report, then these steps with the source's URL.
- PlanetScale failed backups
- PlanetScale backups stop succeeding
- PlanetScale storage running out
- PlanetScale out-of-memory restarts
- PlanetScale schema recommendations
- Report: PlanetScale