gpt4 book ai didi

python - 如何从 grafana V 2.0 仪表板中的图表中获取值

转载 作者:太空宇宙 更新时间:2023-11-03 11:48:12 25 4
gpt4 key购买 nike

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

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

我试过了API Documentation但它很差。没有什么可以从图中获取值

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

如何获取图形值?

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

谢谢

最佳答案

您不会获得查询 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()

关于python - 如何从 grafana V 2.0 仪表板中的图表中获取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34204355/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com