我在“grafana”仪表板 v2.0 上有一个图表。
我想使用 HTTP get(来自 python)从这个图中获取一个值
我尝试过API 文档, 但它很差。没有什么可以从图表中获取值
我只能在文档中找到如何GET /api/dashboards/db/:slug使用提供的令牌获取仪表板 ( )。
我怎样才能得到图形值?
(就像我的指标是这样的queue.prod.high.total_queues)
谢谢
您不会通过查询 Grafana 获得指标值,而是通过 Graphite 获得指标值。在 python 中,您可以使用requests库、Graphite URL API和format参数。
例如:
import requests
response = requests.get('http://your.graphite.host.com/render?target=queue.prod.high.total_queues&format=json')
data = response.json()
Run Code Online (Sandbox Code Playgroud)