Health Evaluation
All checks expose a health stats of passing (Green) or failing (Red).
For example the HTTP check fails if the status is 200 >= code < 299
these default behaviors can be changed using the test
field:
In the example below 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.demo.aws.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 Templating
While test
fields do support Javascript and Go Templates, they are not recommended for health evaluations due to their verbosity and performance.
Variables
Each check exposes different variables to use in the display
expression, See the Result Variables section for each check.