how can i show graphs for 2 different metrics at once on a pane?

11,129 views
Skip to first unread message

Yosef Yudilevich

unread,
Jun 23, 2016, 5:02:44 PM6/23/16
to Prometheus Developers
many times i need to check how was something when something else made problem
like how was mysql queries when cpu was 100.
is there easy way to do it?
thanks

Julius Volz

unread,
Jun 23, 2016, 6:14:50 PM6/23/16
to Yosef Yudilevich, Prometheus Developers
The built-in Prometheus web interface only supports one expression per graph, unfortunately. You can add a second graph by pressing the "Add Graph" button though. Maybe that already helps for visual correlation.

Grafana does support multiple expressions per graph though.

--
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 prometheus-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Kochie

unread,
Jun 24, 2016, 5:59:44 AM6/24/16
to Yosef Yudilevich, Prometheus Developers
One of the more interesting things I've done for this specific metric is to graph CPU / QPS.  This gives you an average CPU cost per query, which can be quite useful to find changes in query patterns.

I have my prometheus scrape both mysqld_exporter and node_exporter to get this.. But since the port numbers are different, the instances don't match.  To solve this, I make a new label with relabeling.

For each of the mysql and node jobs:
relabel_configs:
- action: replace
  source_labels: [__address__]
  target_label: node
  regex: ([\w.-]*?):\d+
  replacement: $1


On Thu, Jun 23, 2016 at 11:02 PM, Yosef Yudilevich <yosef.yu...@gmail.com> wrote:

--

Yosef Yudilevich

unread,
Jun 24, 2016, 6:04:10 AM6/24/16
to Ben Kochie, Prometheus Developers
thanks Ben and Julius

i have found also that with "or" i can put 2 metrics on graph

Julius Volz

unread,
Jun 24, 2016, 7:06:43 PM6/24/16
to Yosef Yudilevich, Ben Kochie, Prometheus Developers
Right, but "or" includes only labelsets from the right that are not present on the left yet. So it only works for metrics which don't have any same labelsets.

For example, "node_load1 or node_load5" would only give you the node_load1 metric.
Reply all
Reply to author
Forward
0 new messages