Combining multiple metric to show on one graph in Prometheus

121 views
Skip to first unread message

Prince

unread,
Sep 13, 2021, 6:20:27 AM9/13/21
to Prometheus Developers
Hey everyone, Can anyone help me with this:

I want to combine two metrics in such a way that both should be displayed on one graph in Prometheus. For eg:
 metric_one{label1:value1} 123
 metrci_two{label2:value2} 345
  
I want these metrics should be displayed on one chart in Prometheus.
The collect() function for this is as:

Collect()
 ch<-prometheus.MustNewConstMetric(c.metric1,prometheus.CounterValue,float64(123))
 ch<-prometheus.MustNewConstMetric(c.metric2,prometheus.CounterValue,float64(345))
}

Bjoern Rabenstein

unread,
Sep 16, 2021, 10:27:52 AM9/16/21
to Prince, Prometheus Developers
On 13.09.21 03:20, Prince wrote:
>
> I want to combine two metrics in such a way that both should be displayed
> on one graph in Prometheus. For eg:
> metric_one{label1:value1} 123
> metrci_two{label2:value2} 345
>
> I want these metrics should be displayed on one chart in Prometheus.

That's not easily possible in the native Prometheus UI, but you can
use a 3rd party dashboarding tool like Grafana, where this is just
normal.

Having said that, there is an ancient GH issue to add the feature to
the Prometheus UI directly:
https://github.com/prometheus/prometheus/issues/39

In yet different news, this is the mailing list for Prometheus
development. If you have question about using Prometheus, the
Prometheus-users mailing list is much more suitable, see
https://groups.google.com/forum/#!forum/prometheus-users . There are
also other community channels to get support, see
https://prometheus.io/community/

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in
Reply all
Reply to author
Forward
0 new messages