Skip to content

Business process (business_process) ​

The state of a service that is made of several sensors, from rules over theirs. "The shop is down when at least two of its three checks are down." "The shop is in warning when any of them is." The sensor reports how many of its sources are up, in warning, down and unknown, and it goes through everything a sensor goes through: limits, the failure count, incidents, notifications, dependencies, pauses, maintenance windows and history.

A business process is never polled. It is computed inside Probeward from what the other sensors already show, so it needs no credential and no network access, and it runs in the core even when its sources are on remote probes. Its interval is how often it is evaluated; it is also evaluated straight away when one of its sources changes state, so it does not wait a whole interval to learn that a check went down.

What it looks like ​

The page of a business process sensor in the light theme

The sensor's page after a few evaluations: three ordinary sensors on a web server (an HTTP check, a TCP check that works and one on a closed port), and a process that is down when at least two of them are. One source is down, so the process is in warning, and the message names it. In the dark theme: the sensor's page. The form for adding it, with the sources chosen from the tree: light, dark.

Setting one up ​

  1. Add a sensor of kind Business process to a device. The device's address is not used; any device will do, for example a "Services" device that stands for the business. The sensor is subject to that device's master check like any sensor on it, so choose a device that is itself reachable.
  2. Under Sources, search for the sensors the process is made of and click them. Any sensor of the tree that you can see may be a source, on any device or probe, including another business process or a combined sensor.
  3. Set the two rules and what a source that cannot be read counts as. The defaults mirror the worst source: down when any source is down, warning when any is in warning or down.
  4. Set the sensor's interval (the suggested 60 s is right for most) and its failure count and notification rules as for any sensor. The failure count counts evaluations: the process pages after that many evaluations in a row that find it down.

Parameters ​

ParameterDefaultMeaning
sourcesnone, requiredThe ids of the sensors the process is made of, 1 to 100, each once. The form picks them from the tree.
down_whenany source is downThe process is down when this rule holds.
warning_whenany source is in warning or downThe process is in warning when this rule holds and the process is not down.
unknown_aswarningWhat a source that cannot be read counts as: warning, down or ignore.

A rule is {"states": ["down"], "at_least": 2} ("at least two sources are down") or {"states": ["warning", "down"], "all": true} ("every source is in warning or down"). states lists the states that count; give at_least (1 or more, not more than the number of sources) or all, not both. "All" means every source that counts: a source left out by unknown_as: ignore is not part of it.

Channels ​

KeyNameUnitDefault limits
sources_upSources upnone
sources_warningSources in warningnone
sources_downSources downnone
sources_unknownSources unknownnone

The four numbers are what the sources are, whatever the rules say, so they add up to the number of sources. You can put limits on them like on any channel (for example an error limit on sources_down is a second way to say "down when two are"), and they are charted.

How a source is read ​

A source that isCounts as
fresh, health upup
fresh, health warningwarning
fresh, health downdown
failing, and has reached its own failure count (it is confirmed failing, or has an incident)down
failing, but not yet at its failure countwarning, so that one lost poll does not turn a process red
paused, outside its monitoring schedule, in a maintenance window that stops pollingcannot be read
stale (no result for several intervals), or on a probe that is not reportingcannot be read
deletedcannot be read, and the message says it no longer exists
not sampled yet, or being polled again after a pause or a reconnectleft out, whatever unknown_as says

A source that cannot be read counts as unknown_as says. warning (the default) makes the process visible as a warning without paging anybody, unless a notification rule opts in to warnings. down is for processes where not knowing is as bad as being down. ignore leaves the source out, which suits a source that is paused on purpose. Acknowledging, suppression by a dependency, a maintenance window that keeps polling and a simulated error do not change how a source is read: they are handling, not health.

When no source can be read (all of them paused, stale or gone, or a restart that has just made every source stale at once) the process decides nothing: its state becomes Unknown with the reason "none of its sources can be read", it does not count towards its failure count, and an incident that is open stays open and is neither repeated nor recovered by it. As soon as one source can be read it evaluates again.

Failure means ​

The down rule holds: enough of the sources are down. The page names them: the process is down: 2 down (Web front, SQL port), and any source that cannot be read with the reason. The sources page on their own as well; a business process is the page for the service, not a replacement for theirs. To page only for the service, set the sources' notification rules to nobody.

Things to know ​

  • A business process cannot be a master check or a dependency of another sensor: it is never polled, so nothing can ask it to confirm its state.
  • Sensors that read each other in a circle are refused when you save, naming the circle.
  • A source is named by its id in the parameters. An export writes the ids; importing into another installation or cloning makes the ids point at nothing there, so the process reads its sources as deleted until you choose them again.
  • The API refuses a source you cannot see, with the same answer as for one that does not exist, so a sensor in your branch cannot be used to read the state of one outside it.
  • Scan now evaluates at once. Pausing the process stops its evaluation as it stops a poll.
  • To page a team only when the service is down and not for each source, set notification rules on the process and leave the sources' own rules empty.

Testing ​

The rules, the failure count, the incident and its recovery, unknown, paused, stale and deleted sources, circles, a restart and the pause are checked on a simulated clock in crates/probeward-engine/tests/derived.rs and in the unit tests of crates/probeward-engine/src/derived.rs. The runtime test (crates/probeward-server/tests/runtime/derived.rs) runs a real server on PostgreSQL with scripted sources, a webhook and a manual clock: one source down is a warning and pages nothing for the process, two down pages once with the process named, and it recovers once. The API test (crates/probeward-server/tests/api/derived.rs) checks the sources' existence and visibility and the circle refusal. The screenshots come from ui/e2e/91-sensor-screenshots.spec.ts against the e2e runtime's own web and TCP targets.

AGPL-3.0-only