Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for graphing multiple unrelated timeseries (metrics) in one graph #39

Closed
juliusv opened this issue Jan 22, 2013 · 25 comments
Closed

Comments

@juliusv
Copy link
Member

juliusv commented Jan 22, 2013

It should be possible to correlate multiple metrics in the same graph. The graphing UI should show (dynamically) multiple expression input fields to enable that.

@ghost ghost assigned juliusv Jan 22, 2013
@brian-brazil
Copy link
Contributor

The console templates graph library supports this, we'd have to hook it into /graph though.

@syepes
Copy link

syepes commented Sep 7, 2016

+1

3 similar comments
@smalot
Copy link

smalot commented Sep 21, 2016

+1

@fmmr
Copy link

fmmr commented Oct 27, 2016

+1

@prasadus92
Copy link

+1

@alexellis
Copy link

~3 years on are we any closer to this happening? @brian-brazil

@juliusv
Copy link
Member Author

juliusv commented Jan 28, 2017

@alexellis No, nobody has spent time on this yet as far as I know.

@mindfulmonk
Copy link

What about this query? It seems to work.

{__name__=~"node_filefd_allocated|node_filefd_maximum"}

@juliusv
Copy link
Member Author

juliusv commented May 31, 2017

@mindfulmonk That works, but has the downside of giving you back all data in one expression, and especially if you apply any transformation that will drop the metric name (rate, increase, sum, avg, etc.), then you won't know anymore what is what.

@tomwilkie
Copy link
Member

tomwilkie commented May 31, 2017 via email

@juliusv
Copy link
Member Author

juliusv commented May 31, 2017

That really seems hacky to me (and could theoretically even conflict with future language changes). If we decide to do this in Prometheus itself at all, I'd prefer a full UI solution to this that allows you to add multiple input fields - either underneath each other or tabbed (like in OpenTSDB).

@G-Harmon
Copy link

+1 to this request

@davkal
Copy link
Contributor

davkal commented Jan 31, 2019

This is supported by Grafana's Explore, which is now available in grafana/grafana:latest as part of the Beta for the upcoming 6.0 release (and no longer behind a feature flag).

@codesome
Copy link
Member

I was digging through issues for possible GSoC projects, so are we still keen on adding this into Prometheus?
/cc @juliusv

@juliusv
Copy link
Member Author

juliusv commented Feb 18, 2019

I think yes, but it's probably not large enough for a GSoC project. Maybe a day or so...

@brian-brazil brian-brazil reopened this Aug 13, 2019
simonpasquier pushed a commit to simonpasquier/prometheus that referenced this issue Nov 13, 2019
…e-go1.12

Remove patches required for Go < 1.12
@beorn7
Copy link
Member

beorn7 commented Sep 28, 2020

At this point, we should only consider this for the new ReactUI.

@cben
Copy link

cben commented Oct 5, 2020

There are two separate reasons this would be nice:

  1. It's usually convenient to share horizontal axis — shifting/zooming time range in sync between all plots.

  2. Overlaying different data on same plot and same vertical scale is sometimes desirable, sometimes confusing.

(1) is just UX convenience, you can simulate it now by copying same end time and range to all plots. But maybe it'd be acceptable to make this always the case — show the time range widgets only once for whole page — since when you want separate time scales you can always use multiple browser tabs?

For (2) there are several possible UI models:

  • Hierarchical: a page is array of panels [Add panel] / [Remove panel]; each panel has array of expressions [Add expression] / [Remove expression].
  • Flat: a page is array of expressions; between expressions have a checkbox [⭥Combine plots], rendering consecutive combined chunks into one plot. This may be weirder but I think it can be convenient to toggle between split and overlaid views.
    • Out of scope: An extreme variant of "flat" is to turn all expression entry boxes into a single editor, with plots popping between editor lines (e.g. CodeMirror can do it). Even weirder for new users 🤯, but would give power to re-arrange many plots by copy-paste...

@jsoref
Copy link
Contributor

jsoref commented Apr 6, 2021

I'm trying to deal w/ the fact that alertmanager likes to send queries to prometheus of the form:

metric{something=...} > trigger_threshold

I'd really prefer alertmanager to be able to send this query to prometheus of the form:

super_impose_all_of_these{metric{something=...}, trigger_threshold}

the difference being w/ >, I can't see where the data was outside the clipped window.

@juliusv
Copy link
Member Author

juliusv commented Apr 7, 2021

@jsoref I assume you are talking about the links back from Alertmanager to the generator of an alert (usually Prometheus), or generally being able to graph alert rule expressions with thresholds extracted somehow into their own visual indicator (vs. filtering).

Prometheus does not have a concept of a "threshold" per se, it just accepts arbitrary PromQL expressions in alerting rules, and those may or may not contain threshold-ish constructs in various places. So it's unfortunately not automatically possible to do such a thing in the Prometheus alerting model.

@jsoref
Copy link
Contributor

jsoref commented Apr 7, 2021

@juliusv: yes, those. I'm not defining trigger_threshold as a magic concept for prometheus

super_impose_all_of_these{metric{something=...}, metric{something_else=...}} would be just as useful to me.

It's possible for some reason that I'd want the second line to have a slope, or a quadratic, or a cubic, or a logarithmic function instead of a constant value.

It just happens that for the average prometheus/alertmanager, what I want for that second metric is a constant value (=trigger_threshold).

Given a magical super_impose_all_of_these{...}, I could figure out how to get prometheus/alertmanager to generate links to prometheus/prometheus that used it and filled out super_impose_all_of_these{metric{something=...}, trigger_threshold} instead of metric{something=...} > trigger_threshold.

@roidelapluie
Copy link
Member

If the labels are different you can use or

@jsoref
Copy link
Contributor

jsoref commented Apr 7, 2021

@juliusv: so, I see this as having these pieces:

  1. prometheus rules (which may contain something threshold like)
  2. a link to alert manager
  3. a link back to prometheus
  4. prometheus offering a way to graph two things as i'm imagining them (which seems to be this issue)

If my magical super_impose_all_of_these{..., ...} existed (4), then (3) could be adjusted to use it. And (2) could be adjusted to use that. And worst case, (1) an extra field could be added to prometheus rules to specify an alternate query to use for graphing instead of the trigger query.

I don't see how or helps me. Certainly, I've tried using or, as in something like:

  topk(10, sum by (namespace, instance) (container_fs_usage_bytes{container!="",container!="POD"} / 1024 / 1024)) by(namespace, instance) or 500

and I get this message:

Error executing query: 1:3: parse error: set operator "or" not allowed in binary scalar expression

@roidelapluie
Copy link
Member

You can try or vector(500)

@jsoref
Copy link
Contributor

jsoref commented Apr 7, 2021

That works. (Could the error suggest that?)

krya-kryak referenced this issue in krya-kryak/prometheus Mar 4, 2022
Fix doc comment for fuzz test
@bboreham
Copy link
Member

Discussed at bug-scrub: consensus was that projects such as Grafana and Perses cover this need, so we can close this issue.
Still open to a PR adding it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests