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

Allow importing a dashboard JSON into grafanalib (for further customization)? #608

Open
fzyzcjy opened this issue Jul 11, 2023 · 3 comments

Comments

@fzyzcjy
Copy link

fzyzcjy commented Jul 11, 2023

As we all know, there are a ton of dashboards in https://grafana.com/grafana/dashboards/, and it saves a lot of time to import it (and do some customization). However, currently I find it hard to convert that JSON into a python file using grafanalib.

@YAMLcase
Copy link

Here's my nightmare use case: I've been handed the task of writing Alert Rules for each of our useful dashboard panels (there are thousands). One thing I overlooked while scoping this project is there's no way to programmatically do this in grafana. And since we're pretty good about dynamically building dashboards with template variables we can't even do it by visiting each panel and creating the alert there.

grafanalib seems like the natural choice for pulling in a dashboard then writing an alert rule around it.

@fzyzcjy
Copy link
Author

fzyzcjy commented Jul 12, 2023

@YAMLcase I have built a small library which supports this feature (JSON -> python), maybe you can have a try? https://github.com/fzyzcjy/grafana_dashboard_python

@amotl
Copy link
Contributor

amotl commented Apr 27, 2024

Hi. We are currently modernizing grafana-import by @peekjef72, adding relevant features to support dashboard-as-code workflows. It also supports grafana-dashboard by @fzyzcjy, thank you so much!

Let us know about any kinds of ideas and suggestions you may have on this matter.

-- https://community.grafana.com/t/backing-up-or-committing-dashboards-to-github/26194/9

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

No branches or pull requests

3 participants