Better Stack webhooks: uptime incidents as signals with a playbook
Send Better Stack's outgoing incident webhooks to Pulso and turn each started or resolved incident into a signal, with columns from its default template or your own.
Better Stack watches your endpoints and opens an incident when one fails. Its outgoing incident webhook can tell Pulso, where the incident becomes a signal with your team’s playbook: who calls the customer, when to post a notice, what to check after it’s fixed.
Connect Better Stack#
Add Better Stack to Pulso to create a webhook source called Better Stack incidents; 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 Better Stack incidents.
- In Better Stack, go to Incidents > Integrations > Exporting data, find Outgoing webhooks and click Configure.
- Click Add on the Incident webhook card.
- Paste the source’s Endpoint URL,
https://hooks.pulso.run/webhooks/<id>/<token>, as the Webhook URL. - Add an
Authorizationheader withBearer <secret>as its value. 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. - Pick the started and resolved events. The default body doesn’t say which event it was, but only a resolved incident has
resolved_at, which is how the monitors below tell them apart.
Through Better Stack’s API, an outgoing webhook with trigger_type incident_change takes on_incident_started, on_incident_acknowledged, on_incident_resolved, on_incident_reopened and on_incident_comment to choose its events, custom_webhook_template_attributes.body_template for its body and custom_webhook_template_attributes.headers_template, a list of name and value, for the Authorization header.
What arrives#
Better Stack’s default template for an incident webhook:
{
"data": {
"id": "$INCIDENT_ID",
"type": "incident",
"attributes": {
"name": "$NAME",
"url": "$URL",
"http_method": "$HTTP_METHOD",
"cause": "$CAUSE",
"started_at": "$STARTED_AT",
"acknowledged_at": "$ACKNOWLEDGED_AT",
"resolved_at": "$RESOLVED_AT",
"response_content": "$RESPONSE_CONTENT",
"response_url": "$RESPONSE_URL",
"screenshot_url": "$SCREENSHOT_URL"
}
}
}
Its monitors see one column per value: data.id, data.type, data.attributes.name, data.attributes.url, data.attributes.http_method, data.attributes.cause, data.attributes.started_at, data.attributes.acknowledged_at, data.attributes.resolved_at, data.attributes.response_content, data.attributes.response_url and data.attributes.screenshot_url.
With your incident metadata#
A custom body template can add the incident’s metadata. $METADATA.Severity renders a key’s values as text, and $METADATA.Owner.email the emails of the team members in it:
{
"incident_id": "$INCIDENT_ID",
"name": "$NAME",
"url": "$URL",
"cause": "$CAUSE",
"started_at": "$STARTED_AT",
"resolved_at": "$RESOLVED_AT",
"severity": "$METADATA.Severity",
"owner_emails": "$METADATA.Owner.email"
}
That gives flat columns, incident_id, severity, owner_emails and the rest, for filters and playbooks. Avoid $METADATA_ARRAY and .values: they render lists, which stay one column each.
Monitors to build#
Incidents on what customers use#
- Filters:
data.typeequalsincident. Adddata.attributes.urlcontainscheckout, orseverityequalscriticalwith the custom template. - Uniq by:
data.id(orincident_id), so the incident’s resolved delivery doesn’t raise a second signal. - Playbook: a question, “Post a notice on the status page?”, with
{{signal.data.attributes.cause}}and{{signal.data.attributes.screenshot_url}}, and a task for support when it’s posted. Add a notification to whoever is on call.
Resolved incidents to review#
- Filters:
data.attributes.resolved_atstarts with2, the first digit of its year, which only a resolved incident has. Adddata.attributes.urlcontains the endpoints you review. - Uniq by:
data.id. - Playbook: a task to write the review, with
{{signal.data.attributes.started_at}}and{{signal.data.attributes.resolved_at}}, assigned to the owner from{{signal.owner_emails}}with the custom template.
Better Stack has heartbeat monitors of its own. A Pulso heartbeat monitor doesn’t fit these webhooks, which only arrive when an incident changes.
Limits#
- No signature. Better Stack doesn’t sign its webhooks, so the source checks the bearer token in the Authorization header instead. If the webhook’s form has no field for headers, set it through the API’s
headers_template. Other headers arrive ashttp_headerscolumns. - No event name. The default body doesn’t say whether the incident started, was acknowledged or resolved, hence the filter on
resolved_at, or your own template. - Check the first event. Better Stack’s docs don’t say how values are escaped inside the template or which
Content-Typeit sends. Check that the first event under Recent events has its columns; a$RESPONSE_CONTENTwith quotes or line breaks is the likeliest to break the JSON.
Sources: Better Stack’s Outgoing webhooks guide and its update an outgoing webhook API reference, with the default templates.
Add Better Stack Uptime to Pulso: a webhook source, 2 monitors with their playbooks and a report, then these steps with the source's URL.
Add to Pulso