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
Severity Behavior 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.
Field Type Required Description expectedstring Yes Expected status code (e.g., "200", "2xx") operatorstring Yes equals, 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.
Field Type Required Description thresholdMsinteger No Maximum 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.
Field Type Required Description warnMsinteger No Warning 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.
Field Type Required Description substringstring Yes Text 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.
Field Type Required Description pathstring Yes JSONPath expression (e.g., $.status) expectedstring Yes Expected value operatorstring Yes equals, contains, less_than, greater_than, matches, range
assertions :
- type : json_path
path : $.status
expected : healthy
operator : equals
severity : fail
Validate a response header value.
Field Type Required Description headerNamestring Yes Response header name expectedstring Yes Expected value operatorstring Yes equals, 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.
Field Type Required Description patternstring Yes Regular 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).
Field Type Required Description minDaysRemaininginteger No Minimum days until expiry (default depends on severity)
assertions :
- type : ssl_expiry
minDaysRemaining : 30
severity : warn
- type : ssl_expiry
minDaysRemaining : 7
severity : fail
response_size
Limit the response body size.
Field Type Required Description maxBytesinteger No Maximum response size in bytes
assertions :
- type : response_size
maxBytes : 1048576
severity : warn
redirect_count
Limit the number of redirects followed.
Field Type Required Description maxCountinteger No Maximum number of redirects
assertions :
- type : redirect_count
maxCount : 3
severity : warn
redirect_target
Verify the final redirect destination URL.
Field Type Required Description expectedstring Yes Expected final URL operatorstring Yes equals, contains, matches
assertions :
- type : redirect_target
expected : https://www.example.com
operator : equals
severity : fail
Operators reference
Operator Behavior Applies to equalsExact string or numeric match status_code, json_path, header, redirect_targetcontainsSubstring match status_code, json_path, header, redirect_targetless_thanNumeric less-than json_path, headergreater_thanNumeric greater-than json_path, headermatchesRegex match status_code, json_path, header, redirect_targetrangeNumeric range (e.g., "200-299") status_code, json_path, header
Common patterns
Health check with status + latency
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.