2

As the title says, I'm trying to collect system metrics using kamon and expose them to Prometheus.

On http://localhost:9095/, I can briefly see the below message:

# The kamon-prometheus module didn't receive any data just yet.

but after refreshing several times I get a blank page. The kamon status page at http://localhost:5266/#/ shows 38 metrics.

Am I missing something?

My setup is as follows, in my main method, at the very top I have

Kamon.init();

I have added this in my pom:

        <dependency>
            <groupId>io.kamon</groupId>
            <artifactId>kamon-bundle_2.12</artifactId>
            <version>2.0.0</version>
        </dependency>

        <dependency>
            <groupId>io.kamon</groupId>
            <artifactId>kamon-prometheus_2.12</artifactId>
            <version>2.0.0</version>
        </dependency>
Mihail Kostira
  • 510
  • 7
  • 10
  • I assume you also added the reporter `Kamon.addReporter(new PrometheusReporter())`. Does http://localhost:9095/metrics shows the same ? – Michael Doubez Jan 15 '20 at 20:58
  • @MichaelDoubez I believe the reporter is activated by including the dependency in the pom. Yes, localhost:9095/metrics is also blank. – Mihail Kostira Jan 16 '20 at 08:58
  • From the documentation of [Kamino](https://archive.kamon.io/documentation/1.x/reporters/kamino/) and of [kamon-prometheus](https://github.com/kamon-io/kamon-prometheus/blob/master/README.md#adding-the-reporter-to-your-project), this seems to be required. I don't know this techno in particular, so I may be wrong. – Michael Doubez Jan 16 '20 at 12:35

2 Answers2

2

After a tip from the kamon gitter channel(thanks Diego Parra!), changing the dependency versions worked for me.

        <dependency>
            <groupId>io.kamon</groupId>
            <artifactId>kamon-bundle_2.12</artifactId>
            <version>2.0.5</version>
        </dependency>

        <dependency>
            <groupId>io.kamon</groupId>
            <artifactId>kamon-prometheus_2.12</artifactId>
            <version>2.0.1</version>
        </dependency>
Mihail Kostira
  • 510
  • 7
  • 10
0

The key change to fixing this is updating kamon-prometheus to version 2.0.1

As mentioned here: https://github.com/kamon-io/Kamon/issues/566

JamesWillett
  • 980
  • 2
  • 8
  • 20