use labels of one metric as labels of another metric

22 views
Skip to first unread message

nesa...@gmail.com

unread,
Dec 30, 2020, 5:14:11 AM12/30/20
to Prometheus Users
Hi
I would like to get all instance labels on the below query having the label role="master":
redis_instance_info
and use it as input of instance label on the below query:
redis_keyspace_hits_total
so that I can get hit ratio of master redises.
How can I do this?

Ben Kochie

unread,
Dec 30, 2020, 12:57:44 PM12/30/20
to nesa...@gmail.com, Prometheus Users
This is what group_left is useful for. For example:

redis_keyspace_hits_total * on (job, instance) group_left (redis_version)  redis_instance_info

--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/50245002-375c-4c80-9cf0-472f5898633fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages