Monitors & detections

Check the value that matters

Use field paths and exact types to verify a JSON response.

Reviewed

A small health-response example

Suppose your endpoint returns the JSON below. To check its database connection, use the field path database.connected, choose Must equal, then select the True value type.

{"database":{"connected":true},"results":[{"status":"ok"}],"queue":0}

Set the rule

  1. Expand JSON response in the monitor editor.
  2. Choose Must exist, Must equal or Must not equal.
  3. Enter a dot-separated path such as database.connected or results.0.status.
  4. For a comparison, choose the value type and enter the expected value where required.
  5. Save and run a check.

Paths and types are exact

Array indexes start at 0. Paths accept letters, numbers, underscores and hyphens, up to 200 characters and 20 levels. Wildcards, expressions and bracket notation are not supported.

Text comparisons are case-sensitive. The number 0 is different from the text "0", and True is different from the text "true". Comparisons support a single text, number, boolean or null value, not an object or list.

A missing field is always an issue

Must exist accepts any present value, including null. Missing fields fail all three rules, including Must not equal. Invalid or truncated JSON also fails.

The complete JSON response must fit within 64 KiB and the check timeout. HTTP checks also require a healthy HTTP status. WebSocket checks validate the first complete text message after the handshake, including an initial greeting. If a text rule is enabled too, both rules must pass on the same response.

A HELPING WING

Let’s find your next step.

Open the chat in the corner to ask a question. Prefer email? Drop us a note and we’ll help you from there.

[email protected]