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

Generate dashboards from grafonnet #35

Merged
merged 4 commits into from
Oct 9, 2023
Merged

Generate dashboards from grafonnet #35

merged 4 commits into from
Oct 9, 2023

Conversation

david-martin
Copy link
Member

@david-martin david-martin commented Sep 29, 2023

closes #18

todo

  • pros & cons of grafonnet
  • decide on using grafonnet or not
  • generate remaining *Route dashboards based on the HTTPRoute jsonnet file (code reuse)

@Ygnas Ygnas force-pushed the grafonnet branch 2 times, most recently from 110e878 to 97559d1 Compare October 9, 2023 13:32
@david-martin
Copy link
Member Author

pros of using grafonnet

  • the dashboard definitions are more readable than raw json export. This gives a better idea of what changes are being made in the git history.
  • panels can be templated, allowing for reuse of common components like tables in the *Route dashboards

cons

  • the grafonnet docs are not great, with limited examples
  • some elements are still quite verbose as they will inevitably be different between dashboards e.g. transformations and overrides where data & columns will practically always be different
  • similar to previous point, some config will be easier to export as json from grafana than write by hand e.g. column widths config

There is another con around development workflow that has been mitigated with the addition of the local_dev script.
In order to visualise changes, you need to run jsonnet to product json for the dashboards, then load the resulting json into a grafana instance.
The local_dev setup does this automatically on each file save, refreshing the grafana dashboard in your browser.

Decision

Let's try this out and see if the pros continue to add value.
This is bi-directional change to the repo, in that we can always return to just commiting the exported json from grafana if the grafonnet fields become a problem for whatever reason.
The local development has been made fairly smooth.
There are some cons called out that may hamper progress, but we'll have to try it out and see if that happens.
We can look to improve things further over time as well.

@david-martin david-martin marked this pull request as ready for review October 9, 2023 15:33
@david-martin david-martin merged commit 4c7021f into main Oct 9, 2023
3 checks passed
@david-martin david-martin deleted the grafonnet branch October 9, 2023 15:34
@david-martin
Copy link
Member Author

Thanks for helping out on this @Ygnas

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

Successfully merging this pull request may close these issues.

dashboard: Investigate using grafonnet for building dashboards
2 participants