Skip to main content

Prometheus

The Prometheus Check connects to the Prometheus host, performs the desired query, and displays the results.

apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: prometheus-check
spec:
interval: 30
prometheus:
- url: http://prometheus-k8s.monitoring.svc:9090
query: kubernetes_build_info{job!~"kube-dns|coredns"}
display:
template: "{{ (index .results 0).git_version }}"
test:
template: "true"

FieldDescriptionSchemeRequired
urlAddress of the Prometheus serverstringYes
queryPromQL querystringYes
nameName of the check, must be unique within the canarystringYes
descriptionDescription for the checkstring
iconIcon for overwriting default icon on the dashboardstring
labelsLabels for checkmap[string]string
testEvaluate whether a check is healthyExpression
displayExpression to change the formatting of the displayExpression
transformTransform data from a check into multiple individual checksExpression
metricsMetrics to export from[]Metrics
connectionPath of existing connection e.g. connection://prometheus/instance
Mutually exclusive with url
Connection
urlRedis hostname and port
usernameEnvVar
passwordEnvVar

Result Variables

NameDescriptionScheme
valuefloat
firstValueNumber of rows returnedint
resultsA list of results[]map[string]interface{ }