Using Prometheus as the metrics backend
Lightbend Telemetry can report metrics to Prometheus using a backend plugin integrated with the Prometheus JVM client .
The following is the core Cinnamon Prometheus dependency that you will need to add to your build tool configuration, together with the HTTP server exporter :
- Java
-
pom.xml
<!-- Cinnamon Prometheus core dependency --> <dependency> <groupId>com.lightbend.cinnamon</groupId> <artifactId>cinnamon-prometheus</artifactId> </dependency> <!-- Cinnamon Prometheus HTTP server dependency --> <dependency> <groupId>com.lightbend.cinnamon</groupId> <artifactId>cinnamon-prometheus-httpserver</artifactId> </dependency>
- Scala
-
build.sbt
libraryDependencies ++= Seq( Cinnamon.library.cinnamonPrometheus, Cinnamon.library.cinnamonPrometheusHttpServer)
After you have made that alteration, enable the HTTP server exporter using the following configuration:
src/main/resources/telemetry.conf
cinnamon.prometheus {
exporters += http-server
}
Metrics from Prometheus will now be available at the configured server location. If you are using the defaults, the location is http://localhost:9001/metrics.
See the Full Telemetry documentation for details and references regarding Prometheus configuration.