Health Evaluation
All checks expose a health status of passing or failing.
HTTP checks pass for 200 <= code < 300 by default, and fail otherwise.
You can change default behavior using the test field:
In the following example, the HTTP check fails if the HTTP response header contains an Authorization field.
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: http-no-auth
spec:
http:
- name: http-no-auth
url: https://httpbin.flanksource.com/headers
test:
expr: "! ('Authorization' in json.headers.keys())"
Boolean
test expressions must return a bool or boolean type string ('true' or 'false')
See CEL expressions for a function reference.
JavaScript and Go templates
While test fields support JavaScript and Go templates, they are not recommended for health evaluations because of their verbosity and performance.
Variables
Each check exposes different variables to use in the display expression, See the Result Variables section for each check.