1 year ago
#367142
JDev
Group prometheus targets by kubernetes labels or annotations?
I have 2 questions about prometheus.
I use this helm chart. https://artifacthub.io/packages/helm/prometheus-community/prometheus?modal=values There is a job "kubernetes.pods". Everything works, but I want to make a few changes.
Is it possible to somehow group targets? For example, by label or annotation? For example, if the label exists, then add the target to the group, if it does not exist, then do not add it. Now in prometheus they are grouped by job_name. But I don't want all pods to be displayed in one section. I want to separate these pods by label or annotation. Is it possible?
How do I use the value from the label for relabel_configs? Tried like this, doesn't work.
__meta_kubernetes_pod_label_vp
$__meta_kubernetes_pod_label_vp
${__meta_kubernetes_pod_label_vp}
Thanks.
kubernetes
prometheus
kubernetes-helm
helm3
0 Answers
Your Answer