Skip to content

Recording Rules

Starter
Professional

You can find documentation on Prometheus Query Language on the web:

PromQL Documentation

PromQL Cheat Sheet

PromQL Example

To create a Recording Rule with PromQL, go to recording rule page and create a new recording rule.

recording rule list recording rule creation

You can write your promql in the first part, if the promql is error-free, it will display the result in the graph with the number of metric it generates at that moment.

You can add threshold warning and/or critical and a name, this name will be used as metric name in status dashboard and notifications.

We have several Cassandra servers running on our Kubernetes, we want to generate one metric to add it to a dashboard and notify us when the sum of the containers’ cpu usage exceeds 50% (warning) and 60% (critical).

PromQL:

sum(container_cpu_used{item=~"k8s_cassandra_cassandra.*"})

~"k8s_cassandra_cassandra.*" This allows you to find all the containers whose item name begins with k8s_cassandra_cassandra

promql cassandra