Daikon Prometheus is a library that add to Daikon the ability to expose metrics for Prometheus.
The main goals are:
- Expose useful metrics for Prometheus
- Add JitPack in your root build.gradle at the end of repositories:
repositories {
...
maven { url 'https://jitpack.io' }
}
- Add the dependency
implementation('com.github.DaikonWeb:daikon-prometheus:1.9.0')
- Add the JitPack repository to your build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
- Add the dependency
<dependency>
<groupId>com.github.DaikonWeb</groupId>
<artifactId>daikon-prometheus</artifactId>
<version>1.9.0</version>
</dependency>
HttpServer()
.prometheus("/prometheus")
.start().use {
assertThat(get("http://localhost:4545/prometheus").text).contains("jvm")
}
HttpServer()
.prometheus("/prometheus")
.get("/counter") { _, _, ctx ->
ctx.meterRegistry().counter("calls").increment()
}
.start().use {
get("http://localhost:4545/counter")
get("http://localhost:4545/counter")
assertThat(get("http://localhost:4545/foo").text).contains("calls_total 2.0")
}
- Documentation: https://daikonweb.github.io
- Examples: https://github.com/DaikonWeb/daikon-examples
- Micrometer: https://micrometer.io/
- Prometheus: https://github.com/prometheus
This project is licensed under the Apache License 2.0 - see the LICENSE file for details