【问题标题】:how to get values from a graph in a dashboard in grafana V 2.0如何从 grafana V 2.0 仪表板中的图表中获取值
【发布时间】:2015-12-10 14:26:24
【问题描述】:

我在“grafana”仪表板 v2.0 上有一个图表。

我想使用 HTTP get(来自 python)从该图中获取一个值

我试过API Documentation,但效果很差。没有什么可以从图表中获取值

我只能在文档中找到如何使用提供的令牌获取仪表板 (GET /api/dashboards/db/:slug)。

如何获取图形值?

(如果我的指标类似于queue.prod.high.total_queues

谢谢

【问题讨论】:

    标签: python grafana


    【解决方案1】:

    查询 Grafana 时,您不会获得指标值,而是 Graphite。在python中你可以使用requests库和Graphite URL APIformat参数。

    例如:

    import requests
    response = requests.get('http://your.graphite.host.com/render?target=queue.prod.high.total_queues&format=json')
    data = response.json()
    

    【讨论】:

      猜你喜欢
      • 2020-02-19
      • 2020-10-02
      • 2018-07-18
      • 1970-01-01
      • 2019-01-29
      • 1970-01-01
      • 2021-05-20
      • 2019-08-25
      • 1970-01-01
      相关资源
      最近更新 更多