8000 GitHub - anhdat/prometheus4j: Prometheus API Client for Java
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

anhdat/prometheus4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheu4j

Prometheus4j is the Prometheus API Client for Java. It's based on Prometheus API documented here

Usage

// query
PrometheusApiClient client = new PrometheusApiClient("http://localhost:9090/");
VectorResponse response = client.query("go_gc_duration_seconds");
System.out.println("response = " + response);

// range query
// use empty string or null to ommit optional parameters
MatrixResponse response = client.queryRange("go_gc_duration_seconds", tenMinEarlier.toString(), now.toString(), "5m", "");

// find series
KeyValResponse response = client.findSeries("up", tenMinEarlier.toString(), now.toString());

Testing

Run a Prometheus instance on Docker with:

docker run -p 9090:9090 --rm prom/prometheus:v2.3.1

Let it run for 10 min. Then start the tests in PrometheusApiClientTest.java file.

License

This software is distributed under the MIT License.

About

Prometheus API Client for Java

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0