Merge/join two metrics in Prometheus/PromQL

rcjsuen picture rcjsuen · Jul 14, 2018 · Viewed 9k times · Source

I have two different (but related metrics).

metric_1(id="abc",id2="def")
metric_2(id="abc",id2="def")

My goal ultimately is to have the following in Grafana. I plan to use the "instant" value and Grafana's table visualization widget to display this data.

id      id2     metric1 metric2
abc     def     1       2

What query/joining/relabeling should I use to achieve this?

Thank you in advance! :)