Selection presets for multi-value varables

  • What Grafana version and what operating system are you using?
    Grafana 9.3.6, Debian stable

  • What are you trying to achieve?
    I’m using Grafana on top of Prometheus with node-exporter (though the question in applies to other exporters, too) and for that I use the Node Exporter Full | Grafana Labs dashboard.

This provides “only” a per host view, but what I also need in addition is an dashboard for one (set of) given metric(s) (e.g. what Note Exporter Full has as “CPU Basic”) for many hosts.
So instead of having all panels from Node Exporter Full, I’d have just one of them but that once for multiple hosts.

What I do so far is

  1. I simply copy&paste the code of the desired panel to a new dashboard.
  2. Add the variables that it uses, which is:
    $node with a query of: label_values(node_uname_info{job=“$job”}, instance)
    $job with a query of: label_values(node_uname_info, job)
  3. Make $node Multi-Value and Include All option.
  4. Edit the panel queries to not use “=” for comparison but “=~” (because with multi value it seems to be a regexp match.

This works fine so far.

But what I’d need in addition is to have sometime like additional “presets” of which hosts I want to display - not just All … or single manually selected hosts.

Consider that I have hosts which serve different purposes and form a group. So ideally I could simply add something like another “All” just named after the group and a regexp of which hostnames fall into that.
“Custom all value” looks like that… but I really don’t want to override “All” and I also have more than just one host group.

Can this somehow be done? E.g. by using another intermediate variable that filters the multivalue $node?

Thanks,
Chris.

I would think it should be possible but with the above requirement especially of $node being multi-value, you might get tripped up in some scenarios.

How would it be possible? :slight_smile:

And what do you mean by tripped up?