Trying to use Test Rule for an Alert on a json file dashboard fails with 'The dashboard needs to be saved at least once before you can test an alert rule'

I think this is a bug, but it could be a naive user error :slight_smile:

I have a dashboard that was created by copying a file in to /var/lib/grafana/dashboards

These ‘dashboards from file’ don’t have a Save icon - I guess the live dashboard always reflects the file on disk. So the save process I have been using is to make changes, export to json, fiddle with the json a little (remove __inputs and hard code the datasource values), and copy the file back in

So far so good. But I tried the ‘Test Rule’ against a reconfigured Alert and got a pop-up saying ‘The dashboard needs to be saved at least once before you can test an alert rule’

So I exported it and copied the exported file back in as a differently named file and dashboard name, but Test Rule gives the same error.

I have tried a few variations on (matching and different) * (filenames and dashboard titles) but all fail the same way.

Am I missing something or is this a bug?

alerts are not supported on json (file) based dashboards. Will likey not be, we are going to depricate that feature, replace with with something that can sync dashboards to db (like wizzy tool)

Thanks for the speedy response.

What approach would you recommend I take if I want a set (4) of similar dashboards which only differ in the datasource? We currently have a too-big dashboard with about 8*4 graphs, each with alerts, and its unwieldy.

Using Save-As results in the copy not having the alert configuration and recreating it by hand is possible but mega tedious.

We’re using v4.4.0-pre1

Use http api and custom import tool, or use a tool like wizzy

wizzy is working out very well so far. Thanks for the pointer.