简体   繁体   中英

Grafana consolidate pod metrics

I have a Kube.netes Pod which serves metrics for prometheus.

Once in a while I update the release and thus the pod gets restarted.

Prometheus safes the metrics but labels it according to the new pod name:

在此处输入图像描述

this is by prometheus' design, so its ok.

but if I display this data with grafana, Im getting this (the pods ahve been redeployed twice):

在此处输入图像描述

So for example the metric "Registered Users" now has 3 different colors because the source from it comes from 3 diffferent pods

I have some options. Maybe disregard the pod name in prometheus, but I consider that bad practise because I dont want to lose data.

So I think I have to consolidate this in grafana. But how I can I tell Grafana that I want to merge all data with container-name api-gateway-narkuma and disregard the label pods ?

You can do something like

max(users) without (instance, pod)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM