Hi, I am using Nabox3
And also, I have some self-built Prometheus , harvest and Grafana
In the Prometheus, I am using recording rules to calculate some metrics and given a new metric name
ex:
groups:
-
name: k8s_pvc_metrics
rules:Precompute PVC Info
- record: kube_pvc_max_info
expr: max(kube_pod_spec_volumes_persistentvolumeclaims_info{namespace=~"$namespace"})
by (persistentvolumeclaim, namespace)
Precompute Namespace Labels with Volume Name
- record: kube_pvc_namespace_labels
expr: label_replace(
kube_persistentvolumeclaim_info{namespace=~"$namespace"}
* on(job, namespace) group_left(label_prodsuite) kube_namespace_labels,
"volume_name", "$1", "volumename", "(.*)"
)
- record: kube_pvc_max_info
But is it possible to have these recording rules in Nabox3
Can I just create this yaml under "/usr/local/nabox/files/prometheus' and add this yaml file to rule_files under prometheus.yml?