Skip to main content

Dashboard

Canary checker comes with a built-in dashboard for displaying canary results, it can be turned off using

--set flanksource-ui.enabled=false

Custom Metrics

Export custom prometheus metrics from your check results

FieldDescriptionSchemeRequired
nameName of the metricstringYes
valueTemplatable float value of the metricstringYes
typePrometheus Metric Type (counter, guage or histogram)stringYes
labelsLabels for prometheus metric (values can be templated)map[string]string

Template input fields:

FieldsDescriptionScheme
checkstring
check.nameNamestring
check.descriptionDescriptionstring
check.labelsLabelsmap[string]string
check.endpointEndpointstring
check.durationDuration in millisecondsint64
resultCheck ResultObject

Sample check with metrics:

# http.yml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: http
spec:
interval: 30
http:
- name: http-minimal-check
url: https://httpbin.demo.aws.flanksource.com/status/200
metrics:
- name: httpbin_2xx_count
type: counter
value: "{{if eq .result.code 200 }}1{{else}}0{{end}}"
labels:
name: httpbin_2xx_count
check_name: "{{ .check.name }}"
statusClass: "{{ .result.code | conv.ToString | strings.Trunc 1}}xx"

# junit.yml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: junit
spec:
interval: 120
junit:
- testResults: "/tmp/junit-results/"
name: junit-pass
display:
template: |
✅ {{.results.passed}} ❌ {{.results.failed}} in 🕑 {{.results.duration}}
spec:
containers:
- name: jes
image: docker.io/tarun18/junit-test-pass
command: ["/start.sh"]
metrics:
- name: junit_check_pass_count
type: gauge
value: "{{.result.results.Passed}}"
labels:
name: junit_check_pass_count
check_name: "{{ .check.name }}"
- name: junit_check_failed_count
type: gauge
value: "{{.result.results.Failed}}"
labels:
name: junit_check_fail_count
check_name: "{{ .check.name }}"
- name: junit_check_duration_ms
type: histogram
value: "{{.check.duration}}"
labels:
name: junit_check_duration_ms
check_name: "{{ .check.name }}"

Grafana

Default grafana dashboards are available, they can be installed with

--set grafanaDashboards=true

Prometheus

The helm chart can install a ServiceMonitor for the prometheus operator, by enabling the serviceMonitor flag

--set serviceMonitor=true

Metrics exposed by canary-checker:

MetricTypeDescription
canary_checkGuageSet to 0 when passing and 1 when failing
canary_check_success_countCounter
canary_check_failed_countCounter
canary_check_infoInfo
canary_check_durationHistogramHistogram of canary durations
Pod Check Metrics
canary_check_histogram{metric="creation_time"}HistogramTime for pod to be Pending
canary_check_histogram{metric="delete_time"}HistogramTime to delete pod
canary_check_histogram{metric="ingress_time"}HistogramTime until ingress is returning requests
canary_check_histogram{metric="request_time"}HistogramDuration of http request once ingress is up
canary_check_histogram{metric="schedule_time"}HistogramTime for pod to be Running
HTTP Check Metrics
canary_check_http_response_statusCounterResponse code counter for each endpoint