On 11 Aug 11:49, Pavan Basetty wrote: > > Hello, > > We currently store device rx_bytes and tx_bytes as separate metrics. I am > trying to get the topk number of metrics sorted by rx_bytes+tx_bytes, but > want to see the actual rx and tx values. >
Yes: label_replace( ( label_replace(rx_bytes, "__tmp_name","$1","__name__","(.*)") or label_replace(tx_bytes, "__tmp_name","$1","__name__","(.*)") ) and ignoring(__tmp_name) topk(1,rate(rx_bytes[1h]) + rate(tx_bytes[1h])), "__tmp_name","","","") > gives the top 10 devices that have total traffic and the total values > (rx+tx). > Is there a way to get the individual rx_bytes and tx_bytes values along > with this data? Essentially sort by total traffic, but get the individual > metric values. > > Appreciate any help with this. > > Thanks > -Pavan > > -- > You received this message because you are subscribed to the Google Groups > "Prometheus Developers" 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-developers/7a788edb-6003-4017-985b-4f53aa42d633n%40googlegroups.com. -- Julien Pivotto @roidelapluie -- You received this message because you are subscribed to the Google Groups "Prometheus Developers" 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-developers/20200811185923.GA258221%40oxygen.

