任何人都尝试过将 prometheus 中的数据读入 java 应用程序。
我希望处理 prometheus 中的指标数据并从中得出一些见解。
找不到任何驱动程序或连接器来连接到 prometheus,除了 prometheus 提供的 HTTP API。
回答1
到目前为止,我只使用 Grafana 从 Prometheus 读取和渲染数据。
我还没有测试过 https://github.com/mckang/promql_java_client,但似乎不止没有。
否则,使用 https://hc.apache.org/httpcomponents-client-5.1.x/index.html 运行 HTTP GET 请求应该非常简单,然后使用 http://genson.io/ 解析结果。