Skip to main content
Assertions define what “healthy” means for your HTTP monitor. Each check evaluates all assertions and records a pass or fail result. A failed fail-severity assertion causes the check to fail; a failed warn-severity assertion records a DEGRADED hint without triggering a DOWN incident.

Severity levels

SeverityBehavior
failCheck is marked as failed. Contributes to incident trigger rules.
warnCheck passes but records a DEGRADED severity hint. Can trigger degraded incident rules.

Assertion types

status_code

Validate the HTTP response status code.
FieldTypeRequiredDescription
expectedstringYesExpected status code (e.g., "200", "2xx")
operatorstringYesequals, contains, matches, range
assertions:
  - type: status_code
    expected: "200"
    operator: equals
    severity: fail
Use range to match a range of status codes:
assertions:
  - type: status_code
    expected: "200-299"
    operator: range
    severity: fail

response_time

Fail when response latency exceeds a threshold.
FieldTypeRequiredDescription
thresholdMsintegerNoMaximum acceptable response time in milliseconds
assertions:
  - type: response_time
    thresholdMs: 2000
    severity: fail

response_time_warn

Record a degraded hint when response time is elevated but not critical.
FieldTypeRequiredDescription
warnMsintegerNoWarning threshold in milliseconds
assertions:
  - type: response_time_warn
    warnMs: 1000
    severity: warn
Use response_time with fail severity for outage detection and response_time_warn with warn severity for early degradation alerts.

body_contains

Check that the response body contains a specific substring.
FieldTypeRequiredDescription
substringstringYesText to search for in the response body
assertions:
  - type: body_contains
    substring: '"status":"ok"'
    severity: fail

json_path

Extract a value from a JSON response using JSONPath and compare it.
FieldTypeRequiredDescription
pathstringYesJSONPath expression (e.g., $.status)
expectedstringYesExpected value
operatorstringYesequals, contains, less_than, greater_than, matches, range
assertions:
  - type: json_path
    path: $.status
    expected: healthy
    operator: equals
    severity: fail
Validate a response header value.
FieldTypeRequiredDescription
headerNamestringYesResponse header name
expectedstringYesExpected value
operatorstringYesequals, contains, less_than, greater_than, matches, range
assertions:
  - type: header
    headerName: content-type
    expected: application/json
    operator: contains
    severity: fail

regex

Match the response body against a regular expression.
FieldTypeRequiredDescription
patternstringYesRegular expression pattern
assertions:
  - type: regex
    pattern: '"version":\s*"\d+\.\d+\.\d+"'
    severity: fail

ssl_expiry

Alert before TLS certificates expire. Requires verifyTls: true (the default).
FieldTypeRequiredDescription
minDaysRemainingintegerNoMinimum days until expiry (default depends on severity)
assertions:
  - type: ssl_expiry
    minDaysRemaining: 30
    severity: warn
  - type: ssl_expiry
    minDaysRemaining: 7
    severity: fail
Stack two ssl_expiry assertions: warn at 30 days for early notice, fail at 7 days for urgent action. See the SSL certificate monitoring guide.

response_size

Limit the response body size.
FieldTypeRequiredDescription
maxBytesintegerNoMaximum response size in bytes
assertions:
  - type: response_size
    maxBytes: 1048576
    severity: warn

redirect_count

Limit the number of redirects followed.
FieldTypeRequiredDescription
maxCountintegerNoMaximum number of redirects
assertions:
  - type: redirect_count
    maxCount: 3
    severity: warn

redirect_target

Verify the final redirect destination URL.
FieldTypeRequiredDescription
expectedstringYesExpected final URL
operatorstringYesequals, contains, matches
assertions:
  - type: redirect_target
    expected: https://www.example.com
    operator: equals
    severity: fail

Operators reference

OperatorBehaviorApplies to
equalsExact string or numeric matchstatus_code, json_path, header, redirect_target
containsSubstring matchstatus_code, json_path, header, redirect_target
less_thanNumeric less-thanjson_path, header
greater_thanNumeric greater-thanjson_path, header
matchesRegex matchstatus_code, json_path, header, redirect_target
rangeNumeric range (e.g., "200-299")status_code, json_path, header

Common patterns

assertions:
  - type: status_code
    expected: "200"
    operator: equals
    severity: fail
  - type: response_time
    thresholdMs: 3000
    severity: fail
  - type: response_time_warn
    warnMs: 1500
    severity: warn
assertions:
  - type: status_code
    expected: "200"
    operator: equals
    severity: fail
  - type: json_path
    path: $.status
    expected: healthy
    operator: equals
    severity: fail
  - type: header
    headerName: content-type
    expected: application/json
    operator: contains
    severity: fail
assertions:
  - type: status_code
    expected: "200"
    operator: equals
    severity: fail
  - type: ssl_expiry
    minDaysRemaining: 30
    severity: warn
  - type: ssl_expiry
    minDaysRemaining: 7
    severity: fail

Next steps

HTTP configuration

Headers, body, TLS, and auth fields.

SSL monitoring guide

Certificate expiry monitoring patterns.

Incident policies

How assertion failures trigger incidents.

Monitoring as Code

Define assertions in YAML.