grafana / grafana-operator

An operator for Grafana that installs and manages Grafana instances, Dashboards and Datasources through Kubernetes/OpenShift CRs
https://grafana.github.io/grafana-operator/
Apache License 2.0
911 stars 397 forks source link

Allow for ignoring a UID embedded in a dashboard or datasource #1674

Open tculp opened 1 month ago

tculp commented 1 month ago

Is your feature request related to a problem? Please describe. I am unable to add multiple copies of a dashboard using the grafanaCom method, as the dashboard in question has a uid embedded in the json. For example: https://grafana.com/grafana/dashboards/12776-redis/

(If applicable)If your feature request solves a bug please provide a link to the community issue https://github.com/grafana/grafana-operator/issues/1499

Describe the solution you'd like I would like to be able to provide an alternate UID in the GrafanaDashboard resource, or have a flag to force a new random UID to be generated.

Describe alternatives you've considered Manually download the json and use the configmap method

tculp commented 1 month ago

Potential defaults that would use the embedded uid (current behavior):

uid: ""
generateUid: false
theSuess commented 1 month ago

We discussed this issue and the way we'd like to solve it is by implementing #1636 for Dashboards. That way, the spec.uid field of the dashboard will always be the UID communicated to Grafana, regardless of the underlying JSON spec.

Keeping this issue open to make sure this use case is covered when implementing the functionality