I have found using kube_deployment_labels help..
However the below expression is only showing the results of deployment
objects that does not have the label.The same expression works for pods
when I use Kube_pod_labels..
(kube_deployment_spec_replicas{job="kube-state-metrics",namespace=~".*"} !=
kube_deployment_status_replicas_available{job="kube-state-metrics",namespace=~".*"})
and
(changes(kube_deployment_status_replicas_updated{job="kube-state-metrics",namespace=~".*"}[5m])
== 0) * on (deployment,namespace) group_left(label_axway_com_team)
kube_deployment_labels
What is the issue with this command?
On Wednesday, December 2, 2020 at 8:06:04 PM UTC-7 [email protected]
wrote:
>
> Is there a way to show deployment object label in prometheus alert rules?
>
> I have a deployment object label set as teamname=teamA I want to show this
> label in KubeDeploymentReplicasMismatch alert.
>
> I could do the same for pods related alerts by modifying expression with,
> * on(namespace, pod) group_left(label_axway_com_team) kube_pod_labels
>
> I am unable to do the same for deployment object related alerts..
>
> I also want to do this for daemonsets, statefulsets, cronjobs, jobs
> related alerts..But I am not sure if there is a way to show the Kubernetes
> object labels in the prometheus metrics ..I see a way only for pod labels.
>
> Any help on this please?
>
--
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/f642cde6-f9d4-42d3-af8a-389a3d4fb611n%40googlegroups.com.