I have grafana dashboards with panels.
Each panel has 1 or more queries (4 max)
The idea is to fetch all the queries that panel is using and execute them in another web application.
I would like to avoid lookup by ids (both dashboards and panels) and use some business name: like “Monthly Sales” panel inside “Sales” dashboard.
Are there json fields like: name, tag, alias or any other that could be used?
Thanks,
but I would need to fetch the panel by some humanly readable (semantically meaningful) identifier; I can’t really rely on its position on the dashboard.
can be done dynamically but it gets hairy and grafana should really not be the source of queries for other systems. this feels uncomfortable
r = requests.get(url = 'http://localhost:3923/api/search?query=%', headers = headers)
for d in r.json():
uid = d.get('uid')
db = requests.get(url = 'http://localhost:3923/api/dashboards/uid/' + uid, headers = headers)
data = db.json()
panels = data['dashboard']['panels']
targets = panels[0]['targets'][0]
type = targets['datasource']['type']
if type == 'mysql':