Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: UID for grafana dashboards #10886

Open
azexs opened this issue Nov 28, 2024 · 7 comments
Open

[Enhancement]: UID for grafana dashboards #10886

azexs opened this issue Nov 28, 2024 · 7 comments

Comments

@azexs
Copy link

azexs commented Nov 28, 2024

Related problem

Changing uid, problem with links in internal project documentation

Suggested solution

Add a configurable uid field to the JSON definitions of Grafana dashboards

Alternatives

Provide default UIDs for the dashboards if no custom UID is set

Additional context

https://github.com/strimzi/strimzi-kafka-operator/tree/main/examples/metrics/grafana-dashboards

@ppatierno
Copy link
Member

Can you elaborate a little bit more the problem you are facing. At least for me, it's really not clear from the only one sentence you provided. Thanks.

@scholzj
Copy link
Member

scholzj commented Nov 28, 2024

I guess it would be good to elaborate not only on the problem but also on the suggested solution since at least to me it is not really clear what you are asking for.

@azexs
Copy link
Author

azexs commented Nov 28, 2024

Currently, configmaps with json definition of grafana dashboard does not contain uid field. Every time the dashboard is imported by grafana-sidecard, e.g. after restarting pod, it is assigned a different uid. We have an internal documentation platform in the company and cannot provide a stable URL for the dashboard.

image

@ppatierno
Copy link
Member

What we provide in the Strimzi repo are just examples of Grafana dashboards, nothing officially supported. On one side, I am not sure that a hard-coded uid can work for everyone (not just for you) but on the other side I think that if we make it unique enough it should not cause problems.
Also what should be the format? Somewhere in the Grafana doc I found it has to be max 40 characters and an increasing number, which doesn't seem to be the case in your above example.

@azexs
Copy link
Author

azexs commented Nov 28, 2024

The uid in the screenshot is automatically generated by Grafana when a new dashboard without uid is created.

Of course, I could disable this option and import them myself, but maybe we could add it to the operator. or make it configurable. https://github.com/strimzi/strimzi-kafka-operator/blob/main/helm-charts/helm3/strimzi-kafka-operator/values.yaml#L77

Regarding the format, if we want to hardcode the value permanently, some random generator might be good enaught. More general uids like "strimzi-kafka-connect", "strimzi-zookeper" could be problematic.

@ppatierno
Copy link
Member

or make it configurable. https://github.com/strimzi/strimzi-kafka-operator/blob/main/helm-charts/helm3/strimzi-kafka-operator/values.yaml#L77

We don't have just Helm but also plain examples and not sure it's something related to the operator.
If just a randomly generated uid is fine we could use it I guess.

What happens to people who already imported a dashboard and after an update from us (i.e. a new field) they update they JSON but with a different uid? I am not the expert here.

@scholzj
Copy link
Member

scholzj commented Nov 28, 2024

I don't think this sounds like somehting what should be configurable in the Helm Chart. If the UIDs should be there, they should be in the regular dashboards in examples and from there copied to the Helm Chart as hardcoded values.

@maciej-tatarski @Frawless @steffen-karlsson @MichaelMorrisEst You did some changes to the Grafana Dashboards recently ... any thoughts on this? Maybe you understand the meaning of the UID better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants