How to remove null panels from dashboard?

I have one Grafana dashboard which displays some VMWare VMs info, but if that VM was deleted, the panel of this VM still appears in Grafana and displays null values.
Is there any easy way to remove such panels? Its not working once clicking on “remove” button and saving the Dashboard.
Adding some details from my dashboard.



You need to purge it in your influxdb.

Good Luck

How I can do this? Is there any automated way to do?

Is it possible to modify the query so it will not display these panels?

As @wlargou suggested, if you don’t want the tags to be returned by the SHOW TAG VALUES query, you need to remove the relevant data from Influx altogether. Specifically the DROP SERIES query - see Manage your database using InfluxQL | InfluxDB OSS 1.8 Documentation for detail on that.

Of course, you may not want to remove the historical data. In that case, one approach may be to modify your template variable query, to only return the list of tags for which recent data was received. This is doable with a nested query like:

SELECT vmname FROM (SELECT last(some_field), vmname FROM vsphere_vm_cpu WHERE vcenter =~ /$vcenter/ AND time > now() - 10m GROUP BY vmname)

Note that some_field needs to be the name of an Influx field that is reliably populated. In the above example a time cut-off of 10 minutes is applied - i.e. only the list of VMs for which data was received in the last 10 minutes will be shown (you can change this depending on the data frequency/reliability in your case).

1 Like

Thanks for the quick reply, thats is really helpful! So as I understand this nested query should be added into “tag values query” field? Or replaced in “Query Options” query?

I’m not too familiar with your setup; in principle that query belongs in the first “Query” box in the screenshot that you shared. But yes, some version of it may need to go in some of the other query boxes also.

To be honest I haven’t used the “Value groups/tags” functionality - it’s gone from experimental to deprecated, and will soon be removed (Variables: Add deprecation warning for value group tags by torkelo · Pull Request #30160 · grafana/grafana · GitHub).

hello @svetb, what you suggest is basically not possible. you have to life with this fact that it is not possible as of now.
best regards habib