How are you trying to achieve it?
I am starting now, but couldn’t find any documentation on this topic, and figured it might be a good place to ask and see if anyone else has worked on such an issue and can provide any ideas, or if it is impossible
What happened?
N/A
What did you expect to happen?
Same as (* What are you trying to achieve? *)
Can you copy/paste the configuration(s) that you are having problems with?
N/A (no configuration setup with problems yet)
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
N/A
Did you follow any online instructions? If so, what is the URL?
N/A
What you want to do is completely possible, but the implementation details depend a bit on what your datasource is. Can you share some of your queries for the panels you currently have displayed?
The data is being consumed by custom Prometheus exporter working on a central host and collecting data from multiple hosts under the centralized host’s maintenance
About the queries, of course, providing 2 example queries below (1 for host and 1 for database) with some explanation
Host
Memory{metric=“FreeMemPct”, target_name=~“$target_name”}
(optionally I tried adding the following: target_type=“host”)
The idea is to show according to the target name the free memory for that host
Database
DB_service{metric=“DB_time”, target_name=~“$target_name”}
(optionally I tried adding the following: target_type=“host”)
The goal is to show the time each database has been up and running according to the target name chosen
The variable target_name is a variable implemented in Grafana
I had 2 ideas:
Implement a way to “show” a row of panels when choosing a specific target_type as mentioned in the original question
Create “dependent” variables target_name & target_type and depending on the target type you choose only specific target_names appear
Just to be clear, what you are envisioning is that one would select a variable from a list at the top (Host, Database and Listener) and then have “only the panels/visualizations” related to that variable. So for Host, it might be:
I originally thought you were just wanting to change a parameter in the query, but this would be the same for each panel/visualization, such as:
Net Generation:
Dynamic dashboards are supported in Grafana 10 with the new Scenes framework. It requires building an App and scripting the logic. It’s not plug-and-plug at the current stage of development.
Another option is to create an Apache ECharts panel that displays charts depending on the selected variables.
Create different dashboards for the Host and Listener. Depending on the selected variables, it will switch between them using Apache ECharts or any other panel that supports locationService. It’s almost transparent for end-users. We demonstrated that in the YouTube tutorial.
Unfortunately we are working on Grafana 9.5 so we don’t have access to the Scenes framework, and our company hasn’t mentioned anything about moving to Grafana 10 in the near future
Also we don’t have access to the Apache Echarts plugin, at our company we only have access to the Grafana plugins
Do you think there is any way to do it?
I had one idea, but not sure if it is really solving the issue
I created 6 dashboards
The 5 that have been starred and one more to create a Dashboard list on, but I couldn’t find a way to hide the stars from that view
I am open to any suggestion, but am very thankful for the possible solutions you have already provided