I have been looking around the forums / google for help for quite some time and I can’t figure out a solution to an issue we are experiencing.
We want to graph data that comes from Opentsdb for a specific metric (let’s say ‘memory’)
The metric name would be like hostname_memory_memory
We defined our hostnames in a custom variable like: hostname1, hostname2, hostname3, hostname4
Right now, we are repeating a single graph per host, so we have 4 different graphs with:
Instead, we want a single graph that contains the memory metric for these 4 hosts.
I couldn’t find an answer to this issue, but I might have missed something.
Could someone assist? Our Grafana version is v4.6.1 (commit: cac8b97)
Thank you for your reply! What you describe would indeed be the intended goal, I am simply wondering if we can do this in a dynamic way so we don’t have to add the queries manually?
For example, in pseudo I would explain it as:
$hosts = hostname1, hostname2, hostname3, hostname4
for each $host in $hosts:
- query Opentsdb #(unless we can query once and distribute the data over the hosts in one graph)
- draw a line on the (same) graph
So without us needing to create a query per host we want to add, but that it creates it for us based on the $hosts (custom) variable that we have created in the dashboard (or just use a single query and plot them all correctly)
I couldn’t find a way of doing this? Is it possible this does not exist?
You can create a template variable that contains a query that gets the list of hostnames (or hardcode it to test in CSV format), and use that template variable in the query.
We have indeed defined it like that and then use $servers in the query, but the issue is that if we then select the “all” option, it seems to use ALL the hostnames (like “hostname1 | hostname2 | hostname3_metricname”) for the graph.
We don’t want seperate graphs per hostname, we want them combined into one.
We can for example graph this when we have the selection on top for a specific host, but if we change it to ‘all’ it is unable to plot them all on a single graph (which is what we want).