-
Notifications
You must be signed in to change notification settings - Fork 371
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
Set organization homeDashboardUID through the grafana operator #896
Comments
Running into the same issue. Although, it is possible to change the default home dashboard via the GUI, so I am wondering how that works? As the OP mentioned, the dashboards declared in the Grafana Operator CR as not saved to files in the default folder location, |
This issue hasn't been updated for a while, marking as stale, please respond within the next 7 days to remove this label |
This is still an issue. |
Hi @nhti , thanks for filing the issue, Can you describe how you would imagine this working for your use case? Do you need more than one organization that you want to set Also, seems like according to this blogpost: https://grafana.com/blog/2022/03/14/how-to-best-organize-your-teams-and-resources-in-grafana/ upstream grafana is discouraging the use of organizations in favor of teams. Are you intending o use Orgs or Teams? |
Hi @HubertStefanski, thank you for the reply,
Preferably, this would be a configuration inside the values.yaml where we can input a dashboard UID and have it as the default home dashboard
At the moment, we only use one org, but options would be good
At the moment we are using Orgs, but no plans on closing down on either of them |
@nhti can you please create a design document that describes how this feature would be implemented as a CRD? |
This issue hasn't been updated for a while, marking as stale, please respond within the next 7 days to remove this label |
unstale! This is still needed, but for the design, it's still a WIP |
This issue hasn't been updated for a while, marking as stale, please respond within the next 7 days to remove this label |
This is still an needed. |
I will put it as accepted, but before any implementation starts we will need a design proposal as defined in https://github.com/grafana-operator/grafana-operator/blob/master/docs/docs/proposals/001%20external%20grafana%20instance.md. |
I am just going to leave a note and add that there are 3 ways to define home dashboard
that according to my understanding atleast ! |
I found a related issue in the Grafana Helm repo: |
Hi! I have the same need to set the home dashboard. We used to have a fork of v4 that implemented something that solved this issue. We had a boolean attribute I understand there could be a better approach, as this allows users to set multiple home dashboards wrongly and also doesn't allow different defaults for teams/orgs/etc. I'm open to discussion and, upon a better solution, I'd be glad to contribute it. |
I've got half a vague idea that it might be possible to launch a sort of short-lived 'startup container' along with the Grafana pod (by describing this in the CRD yaml) which does the appropriate API call to set the home dashboard when the Grafana container comes up. This is still very much half-baked though (I don't know if there is such a call, or how the container would work, or how to get an API username/password set up etc.etc.) and I'd much prefer a simple value in the CRD (Home dashboard UID or path in the hierarchy). |
@jaehnri yeah if we allow, setting it in My feeling around this is that it's easiest if we just implement the preferences API as a new CRD even though it feels a bit silly. https://grafana.com/docs/grafana/latest/developers/http_api/preferences/ I assume all logic for which homeDashboard will be set is handled in grafana so if we start to support We don't plan to ever support multiple orgs, so we don't have to worry about that. @jaehnri if you can describe how that CRD could look like, I think that could be a great start. Unless you think this should be solved some other way. We are open to suggestions. I think the CRD would be rather simple, but if you feel like it, feel free to create a design document, https://github.com/grafana-operator/grafana-operator/blob/master/docs/docs/proposals/001%20external%20grafana%20instance.md. Sound like a good start? |
@NissesSenap I think we should consider making it part of |
Sounds like a good idea @weisdd , let's go with that instead |
I see that Grafana responds with 404 when unknown {
"message": "Dashboard not found",
"traceID": ""
} So, it's a bit trickier than I thought. Potentially, we can have a workaround:
Not as good as hoped, but still a way to go. |
I'm thinking of adding something like this in the spec:
preferences:
homeDashboardUid: "foobar" And then, in the dashboard reconcile, after creating the dashboard, we can compare the if uid == grafana.Spec.Preferences.HomeDashboardUID {
...
err = r.UpdateHomeDashboard(...)
...
} What do you think? |
Is your feature request related to a problem? Please describe.
With the way that the grafanadashboard resource is used, there is no direct reference to a physical file of our grafana dashboard. Therefore, we cannot define a default_home_dashboard_path from the grafana operator.
(If applicable)If your feature request solves a bug please provide a link to the community issue
N/A
Describe the solution you'd like
Grafana has the Update Current Org Prefs which accepts a homeDashboardUID to set as the default home dashboard. So it would be preferable to be able to set a default home dashboard via this API by referencing a dashboard UID from the grafana operator configuration.
Describe alternatives you've considered
Or it would also be beneficial to have a physical file of our defined dashboard inside the grafana pod such that it can be referenced via default_home_dashboard_path
Additional context
N/A
Existing solutions
N/A
The text was updated successfully, but these errors were encountered: