title: How to configure Akka to expose metrics to Prometheus using Kamon?
body: <p>I am trying to configure my project which is based on Akka 2.6.10 to expose metric values to Prometheus. I saw this <a href="https://stackoverflow.com/a/54081547/2096986">question</a> which uses <a href="https://kamon.io/docs/latest/guides/migration/from-1.x-to-2.0/" rel="nofollow noreferrer">Kamon</a> but I couldn't figure out what I am missing on my configuration. My <code>build.sbt</code> file has the following configuration:</p>
  <pre><code>name := &quot;&quot;&quot;explore-akka&quot;&quot;&quot;
  version := &quot;1.1&quot;
  scalaVersion := &quot;2.12.7&quot;
  val akkaVersion = &quot;2.6.10&quot;
  lazy val kamonVersion = &quot;2.1.9&quot;
  
  libraryDependencies ++= Seq(
    // Akka basics
    &quot;com.typesafe.akka&quot; %% &quot;akka-actor&quot; % akkaVersion,
    &quot;com.typesafe.akka&quot; %% &quot;akka-testkit&quot; % akkaVersion,
  
    // Metrics: Kamon + Prometheus
    &quot;io.kamon&quot; %% &quot;kamon-core&quot; % kamonVersion,
    &quot;io.kamon&quot; %% &quot;kamon-akka&quot; % kamonVersion,
    &quot;io.kamon&quot; %% &quot;kamon-prometheus&quot; % kamonVersion
  )
  </code></pre>
  <p>and the <code>plugins.sbt</code>:</p>
  <pre><code>resolvers += Resolver.bintrayRepo(&quot;kamon-io&quot;, &quot;sbt-plugins&quot;)
  addSbtPlugin(&quot;io.kamon&quot; % &quot;sbt-aspectj-runner&quot; % &quot;1.1.1&quot;)
  </code></pre>
  <p>I added on the <code>application.conf</code>:</p>
  <pre><code>kamon.instrumentation.akka.filters {
    actors.track {
      includes = [ &quot;CounterSystem/user/Counter**&quot; ]
    }
  }
  </code></pre>
  <p>then I start a MainClass which call the counterActor:</p>
  <pre><code>object MainClass extends App {
    Kamon.registerModule(&quot;akka-test&quot;, new PrometheusReporter())
    Kamon.init()
    CounterActor.run()
  }
  
  import akka.actor.{Actor, ActorSystem, Props}
  import kamon.Kamon
  
  object CounterActor extends App {
    run()
  
    def run() = {
      import Counter._
      val actorSystem = ActorSystem(&quot;CounterSystem&quot;)
      val countActor = actorSystem.actorOf(Props[Counter], &quot;Counter&quot;)
      (1 to 100).foreach { v =&gt;
        Thread.sleep(1000)
        countActor ! Increment
      }
      (1 to 50).foreach { v =&gt;
        Thread.sleep(1000)
        countActor ! Decrement
      }
      countActor ! Print
    }
  
    class Counter extends Actor {
      import Counter._
      val counter = Kamon.counter(&quot;my-counter&quot;)
      var count = 0
      override def receive: Receive = {
        case Increment =&gt;
          count += 1
          println(s&quot;incrementing... $count&quot;)
          counter.withoutTags().increment()
        case Decrement =&gt;
          count -= 1
          println(s&quot;decrementing... $count&quot;)
          counter.withoutTags().increment()
        case Print =&gt;
          sender() ! count
          println(s&quot;[counter] current count is: $count&quot;)
      }
    }
    object Counter {
      case object Increment
      case object Decrement
      case object Print
    }
  }
  </code></pre>
  <p>I think that after this I could launch the application using <code>sbt run</code> and listen to the metrics on the Prometheus console (<a href="http://127.0.0.1:9090/graph" rel="nofollow noreferrer">http://127.0.0.1:9090/graph</a>), but I do not see any metrics related to my actor. My guess is that I have to configure the <code>scrape_config</code> at the prometheus file <code>/etc/prometheus/prometheus.yml</code>. Am I right? How should I configure it?</p>