I’m putting together a dashboard that uses a number of queries run against SQL Server.
Some of my visuals are based on the same queries, and the visuals often only differ by their Transform steps, and tweaking a few properties for the visuals.
In order to avoid defining the same queries repeatedly, what I’ve settled on doing is to define one row (called “Queries”), showing a bunch of plain tables (one per query), and then I just collapse the row. My visuals are defined in other rows above it, and I use Dashboard as their data source, and Source Panel indicates which panel is used for the (common) source query. This is generally working fine.
What I typically do is that while I’m working on the visual, I define the source query (table) in the same row as the visual, and once I’m done, I move the table away in the collapsed Queries row.
The problem is that in a lot of cases, once I’ve moved the table (the shared query) in the collapsed row, if I look at the properties of a visual (which are all on a different row), I can see Data Source correctly indicates “Dashboard”, but Source Panel is left blank - it shows “Choose panel”, and if I open the dropdown, it might list 2, 3 or any number of seemingly random panels from the same or other rows. The visual is working fine, it’s just that without the source panel being correctly identified, it becomes difficult to determine (and be certain) which is the correct one, so I can go back to the raw SQL statement and (say) make a correction.
I do see that you can name queries (they all default to “A”, which you can rename), but that’s just a name of your own choosing; it doesn’t inherently link to the actual source panel (that’s done through the Source panel dropdown). So I do try to consistently rename my queries (defaulting to “A”) to something that’ll help me determine which is the correct query from the collapsed panel…but it seems to me this should be unnecessary, as the panel name should appear in the dropdown that is designed for that very purpose.
Is this a bug? I’m on the current version of Grafana (11.something).
I realize that the Query Inspector button (then Query / Refresh) will bring up the full text of the query, but that still doesn’t identify the panel from the collapsed row…