community.grafana icon indicating copy to clipboard operation
community.grafana copied to clipboard

Add parameter "UID" to create datasouce with specific uid.

Open gsmolensky opened this issue 2 years ago • 4 comments

Hi all

After upgrading Grafana to version 8.3.* - 8.4.* , guys from Grafana labs they added new parameter into dashboard json model , this is problem if you want to use one dashboard on two different Grafanas ( test / prod), because you have to change uid for every environmnet and easiest way is have option to create datasource with specific uid. Manually it`s possible to create datasource with specific uid.

Previous definition: JSON MODEL:

... "datasource": { "type": "prometheus" }, ...

Actual definition: JSON MODEL: ... "datasource": { "type": "prometheus", "uid": "xxx" }, ...

It is necessary to have option create datasources with specific uid , then re-using Grafana`s dashboards is available.

Thx

gsmolensky avatar Feb 28 '22 08:02 gsmolensky

@gsmolensky can you clarify if you talk about datasource or dashboard. You are mixing both in title and description.

rrey avatar Feb 28 '22 08:02 rrey

I mean datasource, :)

gsmolensky avatar Feb 28 '22 12:02 gsmolensky

I checked this and I have the requirement, too. Problem is to make the uid also backwards compatile for version below 8. Still trying to figure this out....

CWollinger avatar Mar 17 '22 14:03 CWollinger

We are running into this issue as well.

Unable to import dashboards, because the UID doesnt match, and we can not set it.

jseiser avatar Jul 18 '22 13:07 jseiser