Monitoring and Speed · Chapter 3 of 4 · 3 min

Alerts That Reach You

Dashboards only help when someone is looking. Which events deserve an alert, the cheapest reliable ways to send one, and how to avoid alert fatigue.

The failure nobody saw

On this site, a run of builds once failed in Cloud Build while the tests on GitHub stayed green. Production kept running the older version, so nothing looked broken. Several merges never reached visitors, and nobody knew until someone went looking. Every dashboard had the information. None of them told anyone.

That is the difference between monitoring and alerting: monitoring records; alerting interrupts a person.

What deserves an alert

An alert should be rare, important and actionable. For a small site, four events qualify:

  1. A deploy did not go live: the build failed, or the live commit does not match the merged one after a reasonable wait.
  2. The site or a core page is failing: the same blocker in several health runs in a row.
  3. Errors spike: a burst of 5xx responses.
  4. A protection stopped working: backups not taken, a scheduled job not running.

Slow pages, a single failed check or a small speed dip belong on the dashboard, not in your inbox.

The cheapest reliable deploy alert

GitHub already emails you when a workflow you triggered fails. So the simplest deploy alert is a workflow that fails when the merged commit is not live:

want="${GITHUB_SHA:0:7}"
for i in $(seq 1 30); do
  got=$(curl -fsS "$SITE/.../release" | node -pe "(JSON.parse(require('fs').readFileSync(0,'utf8')).sha||'').slice(0,7)" || true)
  [ "$got" = "$want" ] && { echo "live: $got"; exit 0; }
  sleep 30
done
echo "::error::Commit $want is not live after 15 minutes (live: $got)"
exit 1

It runs on every push to main, needs no cloud permissions, and catches every reason a deploy might not land: a failed build, a trigger that did not fire, a revision that would not start. This site's speed workflow already waits for the deploy in exactly this way; turning "measure anyway" into "fail and say so" is a one-line change.

Alerts from the cloud side

For the other events, Cloud Monitoring can send email when a condition holds:

Set them up once in the console, then write down what was created (see The Cloud Map).

Avoid alert fatigue

The fastest way to make alerts useless is to send too many. Rules:

The red alert in the dashboard

Ravi OS also shows a red bar at the top of every screen when something needs attention, which stays until it is acknowledged. That works well while you are using the dashboard. The email alerts above are for when you are not.

Try it yourself

Ask: if my last merge had failed to deploy, how would I have found out, and how long would it have taken? If the answer is "when I happened to look", add the failing post-deploy check to your workflow today.