hi,
is there an easy way to build dashboards in grafana with python but not in a json way but more in object/functions?
json is not the easiest way to understand what goes to where in a dashboards, i want to build from nothing several dashboards+panels + data source + alerts.
using a pre built function
even if there is something that will do 10% of what i need is good for start
kind of SDK for grafana with python
the main issue i have that i don’t want to build the json file, i want to go around this and get something prepare
Hi, I’ve been using the grafana-foundation-sdk for the last few months and it’s been pretty good. The documentation is a little vague at some points, but it gives you what you need.
One downside is that it takes a bit of comparing code-created JSON with what you’d see created by the GUI in order to see what properties you need to include when creating a Panel/Dashboard. Once you’ve got those properties dialed in, however, you can template Panel/Dashboard defaults with Python functions and only customize what you need to, when you need to.
Haven’t played around with uploading via API too much, but you can use the JSONEncoder tool inside your dashboard’s .py file to generate a JSON file that you can easily upload to Grafana.