Recording Rules
You can find documentation on Prometheus Query Language on the web:
Recording Rule creation with PromQL
Section titled “Recording Rule creation with PromQL”To create a Recording Rule with PromQL, go to recording rule page and create a new recording rule.
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.
Example: Cassandra
Section titled “Example: Cassandra”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