Key takeaways
- Settings → Alerts sets an app's alerts for the whole app: who gets the email, the hold between emails (1 to 24 hours), and whether jobs that give up count.
- Only when failures pile up holds a lone failure until N land within M minutes, so one timeout at 3am doesn't page anyone, and a real outage still does.
- A Shopify app can alert when production is installed and was getting webhooks, but none arrived for 1 to 48 hours. A dev server that won't start can email too.
- Alongside the emails, apps.production.failed opens an incident on the team's webhook endpoints and apps.production.recovered closes the same one 30 minutes after the last failure.
A failure email that reaches everyone, every time, gets muted by the end of its first bad afternoon. That is why failure alerts started with one fixed cadence: at most one email per app every 12 hours. The cadence hasn't changed. What has is that each app can now decide who gets it, how often, what counts, and where the incident goes when a person isn't the right first responder.
Before a sale weekend is a good time to go through it. Each setting takes a minute, and all of them live on one page: the app's Settings → Alerts. Owners and admins can change them, and so can a member with Deploy access to the app.
Who gets the email
By default, everyone who can see the app: the team's owners and admins, and the members whose access reaches it. Send to narrows that to chosen people among them. Pick the two who are on call this week and the rest of the team's inboxes stay quiet.
Someone who later loses access to the app stops getting its alerts, whatever the list says. The list never reaches outside the people who could open Logs and read the failure for themselves.
How often
At most one email every sets the hold between emails: 1, 3, 6, 12 or 24 hours. The rule around it is the same as before. The first failure after a quiet spell goes out within a minute. Failures during the hold are kept and sent together when it ends. If nothing else failed, nothing is sent, and the next failure goes out at once.
A short hold is for a week when someone is watching and wants to know within the hour that a fix held. A long one is for an app whose failures are a nuisance rather than an emergency. Either way every failure is still in exactly one email.
What counts
Two switches decide what's in the email at all.
Jobs that give up is on by default. A background job counts once, when its last attempt fails, and never per attempt. Turn it off for an app whose jobs are expected to fail now and then (a courier lookup against a flaky API, say) and whose actions are what matter.
Only when failures pile up is the new one. With it on, a lone failure doesn't send anything. An alert goes out only once at least N failures land within M minutes of each other. The lone failures aren't lost: they wait for an alert that does go out and ride along in it, carried for up to 7 days. So one timeout at 3am on Saturday is in Monday's email, and twenty of them in ten minutes are in your inbox before the eleventh.
Two alerts for things that stop
Most failures are something that happened. Two of the new ones are about something that stopped happening.
Shopify webhooks stop arriving is for Shopify apps. It fires when production is installed on a store, got Shopify webhooks in the last week, and then got none for a span you choose, between 1 and 48 hours. A store that quietly uninstalled, a webhook subscription that lapsed after a scope change, or an address that stopped answering all look like silence, and silence never shows up in Logs' errors. It's off by default, since an app with one store that only sells on weekdays would alert every Saturday.
Dev server won't start is for development. When a dev server fails its last automatic retry, it stays down until someone syncs a file, runs ib-apps dev or opens the preview. With this on, the team gets an email at that point instead of finding out when the next person opens the preview. It's off by default too.
Incidents for Slack and PagerDuty
An email tells people. A tool that pages needs something it can open and close. So alongside the emails, the team's webhook endpoints get two events:
apps.production.failedwhen production starts failing, by the app's alert settings (the pile-up rule included) but never held back the way emails are. It carries the app,rule: "failures", when it started, how many failures, and the groups: each kind of failure with its name, error, count and newest event id.apps.production.recoveredonce nothing has failed for 30 minutes after the incident opened. It carriesincident, which is the failed event'sid.
The pair shares that id, so a tool opens one alert and resolves the same one. A webhook stall is the same pair with rule: "shopify_webhooks_stalled", with the last webhook's time and the hours of silence on the way in, and the next webhook's time on the way out.
Subscribe an endpoint under Team → Webhooks. For Slack, a workflow that posts on failed and threads recovered under it is enough. For PagerDuty, map failed to a trigger with the event's id as the dedup key and recovered to a resolve with its incident. One incident per outage, however many failures it held.
The off switch stays in the code
alerts: { failures: false } in production's settings.ib.ts still turns every alert off, whatever the page says. Production's settings are its last deploy's, so that takes effect on deploy. It's the right place for an app that's being retired, where no one should be paged at all.
Before the weekend
Five minutes, per app:
- Send to: the people on call, not the whole team.
- At most one email every: 1 or 3 hours if someone is watching, 12 if not.
- Only when failures pile up: on, with a threshold that matches your traffic. Three in five minutes is a reasonable start.
- Shopify webhooks stop arriving: on for any app that depends on orders coming in, with a span shorter than your shortest expected gap.
- A webhook endpoint for
apps.production.*, pointed at the channel or the service that wakes someone.
The page lists the app's latest alerts under the settings, so you can check on Monday what went out and whether it was worth sending.
Frequently asked questions
Do the pile-up rule's lone failures get lost?
No. They wait for an alert that does go out and are included in it, for up to 7 days. Every failure is still in exactly one email.
Are incident events held back like the emails?
No. apps.production.failed is sent as soon as the app's rules say production is failing, and apps.production.recovered 30 minutes after the last failure. The emails' hold only applies to emails.
Why is the webhook stall alert off by default?
A store that only sells on some days goes quiet on the others, and the alert would fire on every quiet day. Turn it on for an app whose stores send webhooks all week, with a span shorter than the shortest gap you expect.
Can a Viewer be on the Send to list?
No. The list is chosen from the people whose access reaches the app: owners, admins and members with access to it. Someone who loses that access is dropped from the alerts.