/kamon-prometheus

kamon prometheus integration

Primary LanguageScalaOtherNOASSERTION

Prometheus Integration

Build Status Gitter Maven Central

Getting Started

Kamon Prometheus is currently available for Scala 2.10, 2.11 and 2.12.

Supported releases and dependencies are shown below.

kamon status jdk scala
1.0.0 stable 1.8+ 2.10, 2.11, 2.12

Adding the Reporter to your project

First, add the dependency to your build. For SBT that would look like this:

libraryDependencies += "io.kamon" %% "kamon-prometheus" % "1.0.0"

and for Maven:

<dependency>
    <groupId>io.kamon</groupId>
    <artifactId>kamon-prometheus_2.12</artifactId>
    <version>1.0.0/version>
</dependency>

Then, start the reporter when your application starts:

import kamon.prometheus.PrometheusReporter
Kamon.addReporter(new PrometheusReporter())

That's it! You can now go to `http://localhost:9095 and see the metrics. Check the reference.conf file for more details on what settings can be configured for the module.

Consuming the metrics

Finally, all you need to do is configure a scrape configuration in Prometheus. The following snippet is a minimal example that shold work with the minimal server from the previous section.

A minimal Prometheus configuration snippet
------------------------------------------------------------------------------
scrape_configs:
  - job_name: kamon-prometheus
    static_configs:
      - targets: ['localhost:9095']
------------------------------------------------------------------------------