Skip to content

Check types and flows

A monitor’s definition is one check, or a flow that joins several. Every check runs on a runner and reports a result the alert rules can read.

Group Type Checks
Web & APIs http Status, response time, body text and JSON assertions. Can record the TLS certificate (issuer, expiry, days left).
Databases postgres, mysql A query in a read-only transaction.
mongodb A find, count or aggregate. $out and $merge are refused.
redis Read commands only.
Logs & metrics elasticsearch A count or search over a time window.
promql A PromQL query; optionally one alert per series (each pod or container fires and resolves on its own).
dynatrace Open Dynatrace problems; each becomes an alert, resolved when Dynatrace no longer lists it.
Code script Node, Python or shell on the runner (runtime: local), or in a fresh Docker container (runtime: docker).
Integrations integration Any connection’s action as a check, for example “fail while Sentry has unresolved errors”, or an AWS CloudWatch metric or cost figure.
Several steps flow Steps joined by branches, with saved values, retries, polls, asserts and compares.

Every field of every type is in Check types.

Most checks take an assertion: a condition the result must meet, or the run fails. Assertions are expressions over the result, such as:

status == 200 && json.items|length > 0
first.lag < 60
count <= 50
certificate.daysLeft > 14

A check can also record a value, a number stored with each run (output.value), for threshold rules and charts. For example first.lag records a replica’s lag in seconds, and durationMs records the response time.

Database checks can’t change data:

  • PostgreSQL queries run inside BEGIN READ ONLY, so a query can’t end the transaction and write.
  • MySQL uses START TRANSACTION READ ONLY and refuses multiple statements.
  • MongoDB refuses $out and $merge.
  • Redis allows read commands only.

Integration actions in a flow may write (create a Jira issue, post to Slack). They are explicit steps you add.

A script check runs your code on the runner. It reads its input from the file named in SREINSIGHTS_INPUT_FILE and writes a JSON result to SREINSIGHTS_OUTPUT_FILE. It gets a minimal environment plus the variables you give it: never the runner’s own secrets. Write with ADAM next to the code editor can write or change the script from a description.

  • runtime: local uses the interpreters in the runner image. The standard image has Node; for Python or shell, extend the image or use runtime: docker.
  • runtime: docker needs a runner that can reach a Docker daemon. Private images use a Docker registry connection.
  • Hosted runners don’t run scripts. Lambda runners run runtime: local only.

A flow is several steps in order, built in the flow editor (/monitors/:id/flow): sign in, pass the token on, branch on a value, retry, and assert at the end. Each step can save values (vars.token) for later steps, and every ${…} in a step’s settings is filled in when it runs.

{ "type": "flow", "value": "vars.stuck", "steps": [
{ "id": "login", "type": "http", "config": { "method": "POST", "url": "/login", "connectionId": "…" },
"outputs": [{ "name": "token", "expr": "output.json.token" }], "next": "orders" },
{ "id": "orders", "type": "http",
"config": { "url": "/orders?status=stuck", "connectionId": "…", "headers": { "authorization": "Bearer ${vars.token}" } },
"outputs": [{ "name": "stuck", "expr": "output.json.items|length" }], "retry": { "maxAttempts": 3 }, "next": "check" },
{ "id": "check", "type": "assert", "config": { "expression": "vars.stuck == 0", "message": "Orders are stuck" } } ] }

The compare step checks that values from several steps agree, such as crm.json.email and billing.first.email, and fails the run with the values when they don’t.

Walk through one in Build a flow. Every step type is in Flow steps.

Each run lists the actions it needs, including every step of a flow. A runner leases it only if it provides all of them. Connection secrets reach the runner sealed for that run (see Connections and secrets).

Results from integrations are kept compact: at most 12 KB, with long strings cut at 2,000 characters.