'Reading data from prometheus into Java application

Anyone has tried reading the data from prometheus into a java application.

I am looking to process the metrics data in prometheus and derive some insights out of it.

Unable to find any driver or connector to connect to prometheus, except the HTTP API which prometheus provides.

https://prometheus.io/docs/prometheus/latest/querying/api/



Solution 1:[1]

So far I only used Grafana to read and render data from Prometheus.

With that I have not tested this client, but it seems there are more than none out there.

Otherwise, it should be quite straightforward to run HTTP GET requests using HttpClient, then parsing the result using Genson.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hiran Chaudhuri