Alerting By Integration Pattern
What is worth an alert depends on how an integration works. A flow that runs on a schedule fails differently from an API that answers requests, and a file a partner sends every night fails differently again. This page says what to watch for each pattern, and why. The same advice is what klok.dev will offer as recommended alerts next to an integration once simple alerts are built (Monitoring And Alerts).
What to watch, per pattern
| Pattern | Watch for | Why |
|---|---|---|
A timer or polling ingress (legs T, and I on a schedule) |
Did not run: fewer transactions than expected by a time. Failures | A scheduled flow that stops leaves no failed transaction behind; only its absence shows. Check at a time when it should have run, in your own time zone |
Event processing and egress (legs P, E) |
Failures. Hung: a transaction in progress for too long | A message that fails is retried and then dead-lettered; one that waits on a slow system stays in progress |
A request/reply API (leg A) |
Failures, Hung, Slow: answers slower than the callers can wait | The caller is waiting; a slow answer is a failure for them even when it succeeds |
| A chain with known legs | Incomplete: a finished transaction with fewer completed outgoing legs than the chain has | A step that was skipped looks like success unless you count the legs |
| A file flow (KLK017 move, ingest, deliver) | Expected files: fewer files than the partner sends, by a time. Failed transfers: a destination that could not be written | Partners send on a rhythm; a missing file is the most common problem, and only its absence shows |
How to choose the numbers
- Failures: one is usually enough. Raise it only for a flow that fails now and then by design and recovers on its own.
- Hung: take the longest a transaction normally takes and add a margin. Fifteen minutes suits most event flows; an API's callers give up much sooner.
- Did not run and Expected files: check shortly after the latest time the flow should have run, in the time zone the business works in, and count over a window that covers one run.
- Slow: start from what the callers' timeouts are, not from what is fast.
Things all patterns share
- The broker. Every integration's logs travel over the broker. When it is down, no failure is logged, and a Did not run alert is what fires. The platform's own monitor on the services' console logs says why.
- Environments. Alert on production. A test environment that fails is information, not an incident.
- People. An alert goes to the people who own the integration. Agree who acts, and what they do, before you add it.