Lookup metric label using a different metrics label..

18 views
Skip to first unread message

rw17...@gmail.com

unread,
Mar 4, 2021, 8:20:48 AM3/4/21
to Prometheus Users
Hey all,

So I have a metric `fgHaStatsMasterSerial` which returns the following:
fgHaStatsMasterSerial{fgHaStatsHostname="HOSTNAME",fgHaStatsIndex="1",fgHaStatsMasterSerial="SERIAL2"} 1

The only thing I care about from that metric is the fgHaStatsMasterSerial label however is isn't very user friendly/pretty to view. So I'd like to perform a lookup against a different metric `fgHaStatsSerial` which returns a series for each device in the cluster. E.g.
fgHaStatsSerial{fgHaStatsHostname="HOST1",fgHaStatsIndex="1",fgHaStatsSerial="SERIAL1"} 1 fgHaStatsSerial{fgHaStatsHostname="HOST2",fgHaStatsIndex="2",fgHaStatsSerial="SERIAL2"} 1

I'd like to pull the fgHaStatsHostname variable from that metric and display it to the user. I'm essentially just trying to get the hostname of the current master in the cluster.

How could I accomplish this?

Reply all
Reply to author
Forward
0 new messages