Hi!
I am trying to add additional monitoring rules to Rancher’s Prometheus programmatically by deploying a Kube manifies of kind PrometheusRule.
Basically, it should work like adding additional queries to store into new metrics https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules
For example:
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app: prometheus
name: promtest
namespace: cattle-prometheus
spec:
groups:
- name: test-group
rules:
- expr: |
sum by (instance) (apiserver_request_latencies_count)
record: instance:latency
The problem is, that no such new metric instance:latency
is recorded.
I also tried the same with a separate Prometheus deployment (and Rancher-Monitoring turned off) from https://github.com/coreos/kube-prometheus and it works correctly.
Has anyone successfully added additional Prometheus rules to the existing Cluster-based Prometheus monitoring?
Cheers,
Damian