-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support putting dashboards in folders in mixins #3
Comments
Yep, I'm all for folders and wasn't sure about how to structure the dashboards. The structure looks good to me. |
Are you suggesting to add this to the mixin proposal? If so I have somewhat mixed view on this. I definitely see the use of folders and want them, but it seems to me, that this is very specific to the setup, so I think each individual setup should have its own configuration that decides into what folder a dashboard goes. I think we're putting too much opinion on peoples setups to generalize this, I don't think there will ever be a good default for folder structure as everyone seems to organize them differently. |
I had a play and came up with:
Basically, instead of putting dashboards in WDYT? |
I've so far treated it as largely a consumers responsibility: https://github.com/brancz/kubernetes-grafana/blob/master/grafana/grafana.libsonnet#L100 |
How can users use that to put mixins into specific folders? Do you have an example? |
Alternatively, we could add an (optional) |
I'd rather stay away from adding more global state to mixins. A better link that I should have immediately shared is: https://github.com/brancz/kubernetes-grafana#organizing-dashboards. Meaning if people want to organize dashboards, then that's a very opinionated thing, and it should be left entirely up to the consumer in my opinion. |
I've put together a working PoC for that here: grafana/jsonnet-libs#234 |
IIUC there is nothing about the mixins that require them to be merged into the "global" namespace; thats was a side effect of the early implementations that used them. The change I'm making to our mixin "user" moves them out of the global namespace (for obvious reasons). I agree polluting the global namespace is bad; if we update the mixin spec to make it clear these shouldn't be merged into the global namespace, would that alleviate your concerns? |
Yes, I think we should do this regardless. I still think that choosing the dashboard folder name is something that should be left to the consumer, it's such an opinionated space that I doubt a maintainer's choice of a folder name is universal to users. |
Isn't the whole point of mixins that users can override maintainers choices? I'm more concerned about sensible defaults. We have Grafana's with ~100 dashboards all from mixins, and more mixins are being written everyday. |
Sorry for the late reply. I had to think about this a bit more, but I think you're right, it should be encouraged to make the folder easily configurable I think. I expect users that don't use jsonnet for the entire setup to suffer from this potentially as it's essentially an abstraction and roughly translates into specifying datasources as part of a mixin, which I'm still not entirely comfortable with, but since people aren't forced to use it, I think I could live with it. @sh0rez @metalmatze @csmarchbanks @povilasv thoughts? |
The current spec for mixins doesn't support dashboards folders, which need to be specified in the dashboard provisioning YAML: http://docs.grafana.org/administration/provisioning/#dashboards
I suggest we add a new top-level field,
dashboardFolders
, which is of typemap[folder name]map[dashboard filename]dashboard
if you get what I mean.Integrations can then take care of provisioning the yamls etc to put these into folders. Existing integrations can make this backwards compatible by lifting this all back into the
dashboards
key.WDYT @metalmatze @brancz
The text was updated successfully, but these errors were encountered: