Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get values from a graph in a dashboard in grafana V 2.0

Tags:

python

grafana

i have a graph on a 'grafana' dashboard v2.0.

i want to get a value from this graph using an HTTP get (from python)

i have tried API Documentation but it is very poor. nothing is there for getting a value from a graph

i can find at the documentation only how to get a dashboard (GET /api/dashboards/db/:slug) with a token provided.

how can i get graph values?

(like if my metric is something like queue.prod.high.total_queues)

Thanks

like image 892
Eyal Ch Avatar asked Oct 30 '22 13:10

Eyal Ch


1 Answers

You don't get metric values querying Grafana but Graphite. In python you can use the requests library and the Graphite URL API and the format parameter.

For example:

import requests
response = requests.get('http://your.graphite.host.com/render?target=queue.prod.high.total_queues&format=json')
data = response.json()
like image 115
dukebody Avatar answered Nov 09 '22 11:11

dukebody