Skip to content

Check types

A monitor’s definition is one check. This page lists every check type with its fields, what its expressions and rules can read, and a working example. It also covers the fields around the definition: where the monitor runs, when, and with which parameters.

For the steps of a flow check, see Flow steps. For the expression language, see Expressions.

A monitor is saved with POST /api/v1/monitors (see REST API). The definition sits inside it:

{
"name": "API health",
"enabled": true,
"runsOn": { "group": "prod-eu-dc", "labels": ["linux"] },
"schedule": { "cron": "*/5 * * * *", "timezone": "Europe/Berlin", "inputs": { "env": "prod" } },
"parameters": [
{ "name": "env", "type": "select", "options": ["prod", "staging"], "default": "prod" }
],
"labels": { "team": "payments" },
"definition": {
"type": "http",
"request": { "url": "https://api.example.com/${params.env}/health" },
"assert": { "status": [200], "expression": "json.status == \"ok\"" }
}
}
Field Type Required Default What it does
name string, 1–120 yes The monitor’s name.
description string, up to 2,000 no Free text.
clientId uuid no The client it belongs to.
enabled boolean no true Off: the schedule queues no runs.
definition object yes The check. One of the types below.
parameters array, up to 30 no [] Values a run needs. See Parameters.
runsOn object yes Where it runs. See runsOn.
schedule object yes When it runs. See Schedule.
labels object, up to 30 no {} Names are lower-case letters, digits and _; values up to 255 characters. Routes and silences match on them.

Every monitor names a runner group. There is no fallback: a run nobody leases is recorded as skipped/no_runner.

Field Type Required Default What it does
group string yes A runner group’s id or name. Your organization’s groups are searched first, then hosted groups.
labels string[], up to 20 no [] A runner needs every label to take the run. Labels use lower-case letters, digits, ., _ or -, up to 63 characters.

What a group refuses when the monitor is saved:

  • Hosted runners refuse script checks and flows with script steps (HOSTED_SCRIPT_NOT_ALLOWED), and connections whose secrets stay on your runners. They reach public addresses only, and hold schedules to your plan’s shortest interval.
  • Lambda runner groups refuse scripts with runtime: "docker". If such a run reaches the function anyway, the function refuses it. See Runners.
  • A runner takes a run only if it reports every check type the run needs, including every step of a flow.
Field Type Required Default What it does
cron string, up to 120 yes 5-field cron, 6-field cron with seconds, or a macro such as @hourly.
timezone string no UTC An IANA name such as Europe/Berlin. The cron is read in this zone.
inputs object no {} A value for each parameter on scheduled runs. Leave it out of an update to keep the current values.

Limits:

  • The shortest gap between two runs must be at least 30 s. SREInsights samples the next 12 runs, so 0,5 * * * * counts as every 5 minutes.
  • An instance that runs without servers looks at schedules once per tick (60 s by default), so its floor is 60 s or the tick, whichever is higher.
  • Hosted runners apply your plan’s minimum on top.

A bad schedule answers 400 INVALID_SCHEDULE (unknown time zone, invalid cron, never runs) or 400 SCHEDULE_TOO_FREQUENT.

Parameters are named values a run needs, such as an environment or a threshold. The schedule, a webhook call or Run now supplies them.

Field Type Required Default What it does
name string yes Letters, digits and _, starting with a letter or _, up to 63 characters. Not params, steps, vars, trigger, meta, output or config.
label string, up to 100 no Shown in forms instead of the name.
description string, up to 500 no Help text in forms.
type text, number, boolean, select no text In the UI: Text, Number, True or false, One of a list.
required boolean no false A run without a value is refused.
default string, number or boolean no Used when nothing else gives a value. Must fit the type.
options string[], up to 50 for select The choices.
min, max number no Bounds of a number parameter, both included.

Where values come from. Each source overrides the one before it. The parameter’s default applies last, when no source gave a value.

How the run starts Sources, in order
Schedule The schedule’s inputs.
Run now The schedule’s inputs, then what Run now sends: POST /api/v1/monitors/:id/run with { "params": { … } }.
Webhook The trigger’s saved inputs, then the call body’s params object. Without a params object, top-level body fields with a parameter’s name.

SREInsights converts each value to its type before the run is queued: "900" becomes 900 for a number, "true" becomes true for a boolean. A value that doesn’t fit answers 400 and names the parameter. A monitor isn’t saved while a required parameter has neither a default nor a schedule value. Names nobody declared pass through as given, so a run can also fill a connection’s ${variables}.

How values render.

  • In single checks, settings render only ${params.…} and ${trigger.…} templates, always as text. Any other ${…} stays as written, so a script’s own template literals are left alone.
  • In flows, every ${…} in a step’s config is an expression. See Templates.
  • In expressions, write params.env and trigger.body.version without ${}.
  • Scripts find params and trigger in their input file.

trigger is { type, name, body, receivedAt }. type is schedule, manual or webhook, and body is a webhook call’s JSON body.

Every check type except flow has the same two verdict fields:

Field Type Required Default What it does
assert.expression expression no Truthy: the run is ok. Falsy: failed. Without one, the action succeeding is enough.
value expression no per type A number stored as output.value, for threshold rules and charts.

A run ends in one of four statuses:

Status Meaning
ok The check ran and every assertion passed.
failed The check ran and an assertion failed: the target is unhealthy.
timeout No answer within the check’s timeout.
error The check could not run: DNS, refused connection, bad config, a failing expression.

Expressions in a check see the action’s result (listed per type below) plus params and trigger.

Alert rules read the stored result instead, as output. It is smaller than what the expression saw: rows, documents and hits are cut down to about 12 KB, and long strings are shortened. Each type’s stored fields are listed below. In rule expressions, status is the run’s status and durationMs is the run’s duration.

Every timeoutMs is at least 100 ms.

Type Default Maximum
http 10,000 60,000
postgres, mysql, mongodb 30,000 300,000
redis 10,000 60,000
elasticsearch, promql, dynatrace 30,000 120,000
script 60,000 600,000
integration 30,000 300,000
flow 120,000 900,000

Calls an endpoint and judges its status, time or body. Connection: optional, type http (base URL, default headers, authentication).

Field Type Required Default What it does
request.method GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS no GET The method.
request.url string, up to 2,048 yes An absolute http:// or https:// URL, or a path such as /health when a connection supplies the base URL.
request.headers object no {} Added over the connection’s headers. Values up to 8,192 characters.
request.query object no {} Appended to the URL’s query string.
request.body string, up to 65,536 no Sent with every method except GET and HEAD.
request.timeoutMs integer no 10,000 Time for the complete response.
request.followRedirects boolean no true Off: a redirect is the result.
request.certificate boolean no false Also records the server’s TLS certificate (https only).
request.connectionId uuid no An http connection.
request.connectionVars object no {} Values for the connection’s ${name} placeholders.
assert.status integer[], 1–50 no any 2xx or 3xx Accepted status codes.
assert.maxDurationMs integer no Slower than this fails.
assert.bodyContains string, up to 1,024 no The body must contain this text.
assert.expression expression no Must also hold.
value expression no none A number to record, such as durationMs.

A non-2xx answer is a result, not an error. The body is read up to 1 MB. Timeouts, refused connections, DNS and TLS failures make the run error or timeout with a plain reason such as Host not found (DNS lookup failed) (ENOTFOUND).

Expressions see: status, ok (2xx), headers (lower-cased names), body (parsed JSON, else the text), json (parsed JSON or null), text, durationMs, certificate (or null).

Stored as output: summary, statusCode, durationMs, bodyBytes, finalUrl (after redirects), certificate, value (when set), and assertions: one { name, passed, expected, actual } per assertion.

certificate is { subject, issuer, altNames, validFrom, validTo, daysLeft, valid, trusted, error }. daysLeft is negative once expired. An expiring or untrusted certificate is recorded, not an error.

{
"type": "http",
"request": { "method": "HEAD", "url": "https://www.example.com/", "certificate": true },
"assert": {
"status": [200, 301, 302],
"maxDurationMs": 5000,
"expression": "certificate == null || (certificate.valid && certificate.daysLeft > 14)"
},
"value": "durationMs"
}

Runs one read-only SQL query. Connection: required, type postgres or mysql.

Field Type Required Default What it does
connectionId uuid yes The database connection.
connectionVars object no {} Values for the connection’s ${name} placeholders.
query string, up to 20,000 yes One statement.
params array, up to 100 no [] Bind values (strings, numbers, booleans, null): $1, $2… for Postgres, ? for MySQL.
maxRows integer, 1–1,000 no 100 Rows kept for expressions.
timeoutMs integer no 30,000 Also the statement timeout.

Read-only. Postgres runs the query in BEGIN READ ONLY over the extended query protocol, which refuses several statements in one query, so ROLLBACK; DELETE … can’t leave the transaction. MySQL uses START TRANSACTION READ ONLY and refuses multiple statements. The transaction is rolled back after the query. A query that writes fails with “Postgres refused the query because it writes. Monitor queries run read-only.” (MySQL says the same).

Expressions see: rows, rowCount (all rows returned), first (the first row or null), fields (column names), durationMs.

Stored as output: summary (3 rows), value (default rowCount), rowCount, fields, rows.

{
"type": "postgres",
"connectionId": "6f1c2a9e-0000-4000-8000-000000000001",
"query": "select coalesce(extract(epoch from now() - pg_last_xact_replay_timestamp()), 0)::int as lag_seconds",
"maxRows": 1,
"timeoutMs": 10000,
"assert": { "expression": "first.lag_seconds < 60" },
"value": "first.lag_seconds"
}

Finds, counts or aggregates documents. Connection: required, type mongodb.

Field Type Required Default What it does
connectionId uuid yes The MongoDB connection.
connectionVars object no {} Values for the connection’s ${name} placeholders.
collection string, up to 255 yes The collection.
operation find, count, aggregate no find What to run.
filter object no {} The filter for find and count.
pipeline object[], up to 50 no [] The stages for aggregate.
limit integer, 1–1,000 no 100 Documents kept by find and aggregate.
timeoutMs integer no 30,000 Also the server’s maxTimeMS.

Read-only. A pipeline with $out or $merge is refused. ObjectIds and dates become plain JSON.

Expressions see: documents, count (the count, or the number of documents returned), first, durationMs.

Stored as output: summary, value (default count), count, documents.

{
"type": "mongodb",
"connectionId": "6f1c2a9e-0000-4000-8000-000000000002",
"collection": "jobs",
"operation": "count",
"filter": { "status": "running" },
"assert": { "expression": "count < 50" },
"value": "count"
}

Runs one read command. Connection: required, type redis.

Field Type Required Default What it does
connectionId uuid yes The Redis connection.
connectionVars object no {} Values for the connection’s ${name} placeholders.
command enum yes A read command, listed below.
args string[], up to 50 no [] The command’s arguments.
timeoutMs integer no 10,000 Time for the answer.

Read-only. Only these commands are accepted: PING, INFO, DBSIZE, TIME, LASTSAVE, GET, MGET, EXISTS, TTL, PTTL, TYPE, STRLEN, GETRANGE, LLEN, LINDEX, LRANGE, SCARD, SISMEMBER, SMEMBERS, ZCARD, ZCOUNT, ZSCORE, ZRANK, ZRANGE, HGET, HMGET, HGETALL, HLEN, HEXISTS, HKEYS, XLEN, XPENDING, PFCOUNT, BITCOUNT.

Expressions see: result, durationMs, and for INFO also info: the answer by section, numbers as numbers, such as info.memory.used_memory.

Stored as output: summary, value (default result when it is a number), result (the parsed info for INFO).

{
"type": "redis",
"connectionId": "6f1c2a9e-0000-4000-8000-000000000003",
"command": "INFO",
"args": ["memory"],
"assert": { "expression": "info.memory.maxmemory == 0 || info.memory.used_memory / info.memory.maxmemory < 0.9" },
"value": "info.memory.used_memory"
}

Counts or searches documents, optionally in a time window. Connection: required, type elasticsearch.

Field Type Required Default What it does
connectionId uuid yes The Elasticsearch connection.
connectionVars object no {} Values for the connection’s ${name} placeholders.
index string, up to 500 yes An index name or pattern such as logs-*.
mode count, search no count _count or _search.
query object no { "match_all": {} } The query clause of the Elasticsearch DSL.
window.field string no @timestamp The time field.
window.seconds integer, 10–2,592,000 with window Only documents from the last N seconds.
size integer, 0–100 no 5 Hits returned by search.
aggregations object no Aggregations for search.
timeoutMs integer no 30,000 Time for the answer.

With a window, search returns the newest hits first. An index that matches nothing is an error.

Expressions see: count, hits (each hit’s _id, _index and source fields), aggregations, took, durationMs.

Stored as output: summary, value (default count), count, took, hits, aggregations.

{
"type": "elasticsearch",
"connectionId": "6f1c2a9e-0000-4000-8000-000000000004",
"index": "logs-*",
"mode": "count",
"query": { "range": { "http.response.status_code": { "gte": 500 } } },
"window": { "field": "@timestamp", "seconds": 300 },
"assert": { "expression": "count <= 50" }
}

Runs an instant PromQL query. Connection: required, type prometheus.

Field Type Required Default What it does
connectionId uuid yes The Prometheus connection.
connectionVars object no {} Values for the connection’s ${name} placeholders.
query string, up to 10,000 yes The query.
perSeries boolean no true Judge every series on its own, with one alert per series.
timeoutMs integer no 30,000 Time for the answer.

With perSeries (the default), the expression runs once per series and sees value and labels. Without an expression, every series the query returns is failing, so an alert-style query such as … > 0.9 works as written. The run fails when any series fails. Rules are evaluated per series: each pod or container fires and resolves its own alert, and a run that errors changes no series. Per-series rule expressions see output.value and output.labels of that series.

Stored as output (per series): summary (5 series, 1 failing), perSeries: true, value and failingSeries (the failing count), series (each { labels, value, failing }).

Without perSeries, the expression sees series (each { labels, value }), resultType and durationMs. Stored: summary, value (default: the single series’ value, else the number of series), resultType, series.

{
"type": "promql",
"connectionId": "6f1c2a9e-0000-4000-8000-000000000005",
"perSeries": true,
"query": "max by (namespace, pod, container) (container_memory_working_set_bytes) / max by (namespace, pod, container) (kube_pod_container_resource_limits{resource=\"memory\"}) > 0.9"
}

Lists Dynatrace problems, so a lost webhook can’t leave a problem unseen or an alert open. SREInsights opens or updates an alert per problem, as the webhook would, and resolves alerts for problems Dynatrace no longer lists as open. Connection: required, type dynatrace, with an API token that has the problems.read scope.

Field Type Required Default What it does
connectionId uuid yes The Dynatrace connection.
connectionVars object no {} Values for the connection’s ${name} placeholders.
problemSelector string, up to 1,000 no status("open") Dynatrace’s problem selector. Keep status("open") so closed problems resolve in SREInsights.
timeoutMs integer no 30,000 Time for each page.

It reads problems from the last 30 days, up to 5 pages and 250 problems.

Expressions see: problems (each { pid, displayId, title, status, severityLevel, impactLevel, entities, tags, startTime }), count, complete (false when the limit cut the list short), durationMs.

Stored as output: summary, value (default count), count, complete, problems.

{ "type": "dynatrace", "connectionId": "6f1c2a9e-0000-4000-8000-000000000006", "problemSelector": "status(\"open\")" }

Runs Node, Python or shell code on the runner, or in a fresh Docker container. Connection: optional, type docker_registry, to pull a private image.

Field Type Required Default What it does
language node, python, shell yes The interpreter.
code string, up to 100,000 yes The script.
runtime local, docker no local local: a process on the runner host. docker: a fresh container per run.
image string, up to 300 no node:22-alpine, python:3.12-slim, alpine:3.20 Docker only: the image.
env object no {} Environment variables for the script. Values up to 10,000 characters.
network boolean no true Docker only: network access for the container.
registryConnectionId uuid no Docker only: a docker_registry connection for a private image.
timeoutMs integer no 60,000 The script is killed after this.

Input and output. The script gets these variables:

Variable What it holds
SREINSIGHTS_INPUT_FILE A JSON file with trigger, params and meta. In a flow, also steps (earlier steps’ outputs) and vars.
SREINSIGHTS_OUTPUT_FILE Write JSON here to return it as data.
SREINSIGHTS_WORKDIR The script’s own work folder, removed after the run.

Instead of the output file, the script can print a line ::sreinsights:output:: {json}. The last such line counts, and the file wins over the line.

Environment. A local script gets a short fixed list of the runner’s environment (PATH, HOME, LANG, LC_ALL, TZ, TMPDIR, SSL_CERT_FILE, NODE_EXTRA_CA_CERTS and the proxy variables), the names the runner’s operator lists in SREINSIGHTS_SCRIPT_ENV_PASSTHROUGH, and the check’s own env. A docker script gets only the check’s env and the variables above. No script ever sees SREINSIGHTS_SECRET_*, the registration token or the runner’s identity. See Runner settings.

Docker. The container runs with --cap-drop ALL, no-new-privileges, 512 MB of memory, and the work folder mounted at /sreinsights. The runner needs the Docker CLI and a daemon. The SREInsights runner image runs local Node scripts on its own Node. local Python and shell scripts need a runner image with those installed; otherwise use runtime: "docker".

Where scripts can’t run. Hosted runners refuse scripts. Lambda runner groups refuse runtime: "docker".

Expressions see: exitCode, data (the returned JSON or null), stdout, stderr, durationMs. Without an expression, exit code 0 passes.

Stored as output: summary (exit 0), value (default data when it is a number, else data.value), exitCode, data, and the last 2,000 characters of stdout and stderr.

{
"type": "script",
"language": "python",
"runtime": "docker",
"image": "python:3.12-slim",
"env": { "SITE_URL": "https://app.example.com" },
"code": "import json, os\nwith open(os.environ[\"SREINSIGHTS_INPUT_FILE\"]) as f:\n data = json.load(f)\nresult = {\"ok\": True, \"value\": 1}\nwith open(os.environ[\"SREINSIGHTS_OUTPUT_FILE\"], \"w\") as f:\n json.dump(result, f)\n",
"timeoutMs": 120000,
"assert": { "expression": "data.ok" },
"value": "data.value"
}

Runs one action of a saved connection as the check, such as “fail while Sentry has unresolved errors”. Connection: required, of any type whose integration offers the action. For every action and its parameters, see Connection types.

Field Type Required Default What it does
connectionId uuid yes The connection. Its integration must offer action.
action string, up to 60 yes The action’s name, such as listIssues.
params object no {} The action’s parameters.
connectionVars object no {} Values for the connection’s ${name} placeholders.
timeoutMs integer no 30,000 Time for the action.

The runner checks params against the action: it fills defaults, converts JSON, number and boolean fields, and refuses missing required parameters and names the action doesn’t take. Saving refuses a connection whose integration has no such action, and lists the ones it has.

Expressions see: the action’s result and durationMs. A result that isn’t an object is result.

Stored as output: summary, value (default count, else total, else the number of issues), and result: the action’s result cut to about 12 KB, with strings over 2,000 characters shortened. An action that sizes its own output, such as code excerpts, is kept whole up to about 60 KB.

Open Sentry errors from the last hour:

{
"type": "integration",
"connectionId": "6f1c2a9e-0000-4000-8000-000000000007",
"action": "listIssues",
"params": { "query": "is:unresolved level:error", "statsPeriod": "1h", "limit": 25 },
"assert": { "expression": "count == 0" },
"value": "count"
}

Average EC2 CPU over 15 minutes, through an aws connection (the result has value, datapoints, unit, min, max, avg):

{
"type": "integration",
"connectionId": "6f1c2a9e-0000-4000-8000-000000000008",
"action": "cloudwatchMetric",
"params": {
"namespace": "AWS/EC2",
"metricName": "CPUUtilization",
"dimensions": "{ \"InstanceId\": \"i-0123456789abcdef0\" }",
"statistic": "Average",
"periodSeconds": 300,
"minutes": 15
},
"assert": { "expression": "value == null || value < 80" },
"value": "value"
}

CloudWatch alarms in ALARM whose names start with prod-:

{
"type": "integration",
"connectionId": "6f1c2a9e-0000-4000-8000-000000000008",
"action": "cloudwatchAlarms",
"params": { "state": "ALARM", "namePrefix": "prod-" },
"assert": { "expression": "count == 0" },
"value": "count"
}

Several steps joined by branches, with values passed between them. The fields and every step type are in Flow steps.

Field Type Required Default What it does
steps array, 1–50 yes The steps.
start step id no the first step Where the flow starts.
timeoutMs integer no 120,000 Time for the whole flow.
assert.expression expression no Checked after the last step. Falsy: failed.
value expression no none A number to record, such as vars.stuck.

Stored as output: summary (4 steps, ended at check), value, steps (one entry per step that ran), vars, logs, and failedStep when it stopped early.

type: "job" is the run of a data job. SREInsights builds it when a job’s run is queued; a monitor can’t use it (400 JOB_TYPE_ON_MONITOR). See Job types.

New monitor → Templates opens a form filled in from a template. You still choose the connection. There are 46 templates:

Group Templates Check type
Websites & APIs Website is up; TLS certificate expiry; Page shows the right content; Sign-in endpoint validates input; Protected endpoint requires a token; socket.io handshake; Static asset or CDN object; Sitemap is served; Shopify storefront lists products; Shopify cart answers; JSON health endpoint http
Websites & APIs Single-page app bundle loads script (Node)
AWS & cost EC2 CPU high; RDS connections near the limit; RDS free storage low; Load balancer 5xx; Load balancer response time; Lambda errors; SQS messages waiting too long; CloudWatch alarms firing; Daily AWS spend over budget; AWS spend jumped; AWS budgets exceeded; Month-end forecast over plan integration (AWS)
Kubernetes & Rancher Container memory near its limit; Container OOMKilled; Pod crash looping; Deployment replicas unavailable; Node memory high; Node memory pressure; Volume almost full promql
Logs 5xx responses over a limit; Error log spike elasticsearch
Databases Postgres replication lag; Postgres long-running queries; Postgres connections near the limit postgres
Databases MySQL replica lag mysql
Databases Redis queue backlog; Redis memory near maxmemory redis
Databases MongoDB jobs piling up mongodb
Dynatrace Dynatrace open problems dynatrace
Integrations New Sentry errors integration (Sentry)
Integrations Health check, then tell Slack and roll back flow
Flows & scripts Sign in, call the API, check the result flow
Flows & scripts Custom Node.js check; Custom Python check (in a python:3.12-slim container) script