Hello everyone, I believe my query should be reasonably straight forward so i’ve skipped out a couple questions from them template to cut to what matters. I’m still quite new here and if theres a similar discussion that i could not find on this then i’d greatly appreciate a redirection.
-
What are you trying to achieve?
Using Grafana’s variables to visualise multiple time-series graph on the same panel. -
How are you trying to achieve it?
In the database are two tables: grpc and nodes. I have connected the name of the nodes to the data to achieve the following table via the below SQL
There are currently two (satellite) nodes: “NS” and “AL”.
- What happened?
Grafana merges the two graphs into one, as it does not separate on the node_name. See below screenshot.
The two nodes’ data can be viewed separately with multiple queries with a where clause on the node_id. However, as i want to eventually be able to use variables this is not scalable. Also, even if i did leave it “merged” in one query, the title of the legends and the same - pop_ping_latency meaning you cannot hold ctrl+click and hide them as you normally would.
- What did you expect to happen?
Something like this (please note that the data itself is different, but the way that it presents under different colours and the legend having the name of the nodes is what’s desired):
One solution would be to have each property of the nodes in separate tables and add the template variable into the SELECT part of the clause instead of the WHERE. For example, SELECT datetime, $nodes FROM latency
, however for this specific database that is not possible. All the data i need is in front of me in Grafana on that table in the first screen shot. Is there no way to have multiple time series graphs on the same panel if the variable its selecting by is in the WHERE part of the SQL query? Thank you!