Hello,
I'm trying to get the result from two different prometheus metrics.
Basically my need is, I want to set an alert on container restart count but
the list also includes cron jobs which I don't want. I only want to get
container restart count for deployments, statefulsets and daemonsets. For
which I built following query expression:
app:kube_cronjob_info:sum =
sum by (container, label_app) (sum(kube_cronjob_info{cronjob=~".*"}) by
(cronjob, namespace) * on (namespace, cronjob) group_left(app)
label_replace(kube_pod_container_status_restarts_total, "cronjob", "$1",
"container", "(.*)"))
I just took a reference from here:
https://groups.google.com/forum/#!topic/prometheus-users/NBbShXgn-6E
But this recording rule doesn't work in Prometheus (v2.21). It returns an
error of "many-to-many matching not allowed: matching labels must be unique
on one side"
Can anyone please help me to achieve this?
Thank you..
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/6c7c71d9-f989-4b6c-943c-41f78a81baean%40googlegroups.com.