Skip to main content

Prometheus

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

promtheus.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: prometheus
spec:
interval: 30
prometheus:
- url: https://prometheus.demo.aws.flanksource.com/
name: prometheus-check
query: kubernetes_build_info{job!~"kube-dns|coredns"}
display:
expr: results[0].git_version
FieldDescriptionScheme
name*

Name of the check, must be unique within the canary

string

query*

PromQL query to execute

string

url*

Prometheus instance, if not specified in installation it is required

string

description

Description for the check

string

display

Expression to change the formatting of the display

Expression

icon

Icon for overwriting default icon on the dashboard

Icon

labels

Labels for check

map[string]string

metrics

Metrics to export from

[]Metrics

test

Evaluate whether a check is healthy

Expression

transform

Transform data from a check into multiple individual checks

Expression

connection

The connection to use, mutually exclusive with username and password

Connection

username

EnvVar

password

EnvVar

Result Variables

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