有什么方法可以解析从 /metrics 端点抓取的输出吗?

Is there any way I can parse the output that has been scraped from /metrics endpoint?

当我们抓取 etcd 暴露端点(即“/metrics”)时,我们得到一个平面文本。有什么方法可以构建整个数据以对其进行处理,而不是对所需指标进行字符串比较?

注意:不想用prometheus做监控。相反,我想创建自己的框架来监控 etcd。

https://github.com/prometheus/prom2json 可能就是您要找的。