Hello, I’m trying to set a particular dashboard as the default for my server, but am not having any success in getting my changes to take, either via the web GUI or via the grafana.ini file. I’m trying to use the instructions at Change home dashboard | Grafana Labs
Default will not change from the stock “Welcome to Grafana” dashboard
I saved my desired default dashboard to a .json file, saved it to /etc/grafana/provisioning/dashboards/ -rw-r–r-- 1 grafana pace-admins 1850 Jul 14 16:01 Home-GT-1626292060718.json
I changed the default dashboard of my grafana.ini file thusly:
and cycled grafana-server – same old default holds.
I then discovered that there is ANOTHER /dashboards folder at /usr/share/grafana/public/dashboards/, so also copied my .json folder there. No change, same old default dashboard
Further, in the web GUI, if I attempt to select this (starred) dashboard and make it default, and Save, the default dashboard always returns to “Default”
So what is the trick to getting my chosen dashboard to be the default, because the documented solution is not working.
Thanks Fadjar, but that did not work. Created a team, added members (including myself) then in team settings, selected the dashboard I want. Upon clicking Save, the selected dashboard reverts instantly to “Default”. So my selection does not stick.
I find it also strange that the default dashboard I set in the grafana.ini default_home_dashboard_path = also does not have any effect.
Also, I am unable to save changes to the default “Home” dashboard. For example, if I remove the “Welcome to Grafana” panel and the blog panel. Then save, I get no error. But if I open a different panel, then return to Home, the stock panels are restored. I do not need or want adverts for Grafana in my company dashboard.
Is your Grafana DB backend using sqlite as default or using mysql?
If using sqlite, please check the permission of the files at /var/lib/grafana/grafana.db
If using mysql, please check the tables of grafana database, is there any anomalies, such as missing id or something.
@gbprometheus unfortunately three different concepts are being mixed up here:
provisioned dashboards
the default dashboard setting in grafana.ini
the default dashboard setting in the Grafana UI.
I know the docs are a bit unclear, but let’s start from the start.
Firstly, you don’t need to use provisioned dashboards here. You maybe could, but you’re adding a layer of complication. Indeed, provisioned dashboards can’t be edited - which is why you weren’t able to save any edits to your provisioned dashboard.
Secondly, if you want to use the setting in the grafana.ini file, I believe you need to pass the absolute path to the file containing the dashboard JSON. I haven’t used that setting before personally, but don’t see evidence in the documentation that a relative path would work.
Thirdly, I would ask this: do you definitely need to set the default dashboard for your server, or for an individual organization? The two would of course be equivalent if you only have a single organization.
If you just need to set it for an individual organization, just follow the six steps here: Change home dashboard | Grafana Labs. It’s a bit simpler than what @fadjar340 outlined in his first response (though what he recommended would work too). This is probably the best way to do it, as it doesn’t require you to export the dashboard to a file and edit grafana.ini to point to it.
Finally, whenever troubleshooting anything like this, I would strongly encourage you to check the Grafana server logs. I have a suspicion that some relevant errors may have been logged there (e.g. when trying to save over a provisioned dashboard)
I removed the .json file from my /etc/grafana/provisioning/dashboards/, so that issue has been removed from the equation, but the problem persists.
I shall attempt an absolute path in grafana.ini for default_home_dashboard_path =
Rather silly (nicer than what I really think) of Grafana Labs to suggest in it’s own documentation that a relative path is acceptable if it is not. But not the first time I have found Graf documentation, um, lacking.
To your third question – yes, I need to set a default dashboard. My default, will be a dashboard list, so that users will immediately get a choice for what they need to view. Further, it will be branded for our organization, not with the clutter of the #$%@ Grafana advert panels as the first thing my users see.
I have a single organization. In my OP, I referenced my attempt to use the six steps. They do not work. Agreed – having to hack up the grafana.ini seems to me an absurd and laborious way to set a default dashboard. The the UI method does not work despite that I am admin of my server, organization (only 1) and team (only one).
Given that you have just one org, I think it’s worth trying to simply set the default for the org via the UI (in org settings). I’ve done this many times and never had issues with it.
If, as you describe, your setting returns to “Default” every time you try to set another dashboard, then I suspect that @fadjar340 was right to suggest that maybe there are issues with your Grafana database that prevent settings from being saved. If that’s indeed the case, it should be the first thing to fix before moving on to anything else. The Grafana server logs will probably give some clues in that respect…
I have once again attempted to save the default dashboard via the UI, in org settings, and tailed the log while I did so. This is the only events logged. BTW, I am gbeyer3:
Hm…that’s a tricky one. I just did it a few times locally and indeed there are no log messages that get generated (even in debug/trace mode) when the settings are changed successfully.
Are you able to successfully change/save any of the other org settings? E.g. Org name, UI Theme, or Timezone?
Also, just for reference, what Grafana version are you on?
Svetb, I was able to create a new org. Then I successfully changed the name of my Main Org, and back.
I am unable to change UI theme and timezone or home dashboard for myself, or for my team. I’m on Graf v 8.0.1
works pretty well, while /var/lib/grafana/dashboards is the directory with all provisioned dashboards, and in the provisioning dir I only have a provider definition:
P.S. It works even for unathenticated anonymous grafana instance, where you can’t star dashboard or assign it to a team, because you have no users there.
Nope, that doesn’t work with Grafana 11.4 with provisioning in a Docker container. Whatever default_home_dashboard_path wants, there is first no /var/lib/grafana/dashboards, second, the provisioned /etc/grafana/provisioning/dashboards does not work, and with or without .json doesn’t matter anyway.
Why is Grafana documentation so bad and fixated at interactive configuration?
Feel free to improve doc. But I would recommend to read the doc first. For example:
No interactive configuration (I guess you mean “clicking in the UI”) and you can configure what you want, not just dashboard. For example I use in some cases: