Closed smutel closed 10 months ago
Same here
yes. same here. seems like changing the datasource is not working.
i have fixed the problem manually. not sure whether it's the correct way or not, but it's working well to change datasource.
basically I just find and replace all the lines of:
"datasource": "your-datasource-name",
to:
"datasource": "$DS_PROMETHEUS",
seems like your-datasource-name
is set when you import the dashboard.
How can I do this in Grafana v8.5
In Json editor press ctrl + H, then you need to replace all instances of this filed (that contains an uuid which will vary in yours):
"datasource": {
"type": "prometheus",
"uid": "fd1b579f-668g-4763-9c61-cbg6c6e605t7"
},
with this:
"datasource": "$DS_PROMETHEUS",
Also finding this. The datasource fix mentioned by @hossein1376 didn't work for me. Rev33 Grafana is version 10.1.5
EDIT: It does actually work. There were a bunch of uids of 00000001 or similar. I replaced them too and it started to work as expected.
This is surely a bug?
I have the same problem. The reason seems to be that after importing, Grafana somehow rewrites the dashboard’s DS_PROMETHEUS
variable to some fixed data source,... and it also shows the variable then to be unused (under Settings/Variables).
So possibly a bug in Grafana itself?
I also found https://community.grafana.com/t/dashboard-import-with-datasource-variable/4896 but not sure whether this really solves anything.
For me, this fixes the issue. At least it seems so. (Ignore 65e38a6... I had only fetched the current upstream master
and forgot to merge it when I branched off).
I'm a bit unsure about these 00000001
UIDs that come up when one imported the old version (i.e. the one where ${DS_PROMETHEUS}
is replaced with the datasource UID chosen in the import dialogue by Grafana).
Only some were 00000001
and other were some UUID.
I guess with my commit, all would be the UUID (from the datasource selected in the dashboard) or maybe even he real name of the datasource as string?!
Nevertheless, it seems to work.
Maybe related to https://github.com/grafana/grafana/issues/80666
Hello,
I have setup this dashboard with 2 prometheus datasources. When I switch from one datasource to another one, the jobs are not updated.
Thanks.