0

I'm working on a Kafka streams application written in scala 2.13 project with the following Kamon packages:

libraryDependencies += "io.kamon" %% "kamon-datadog" % "2.5.4"
libraryDependencies += "io.kamon" %% "kamon-bundle" % "2.5.4"
libraryDependencies += "io.kamon" %% "kamon-kafka" % "2.5.4"

And the following Kamon configurations:

kanela {
  show-banner = true
  log-level = "DEBUG"

  modules {
    kafka-client-module {
      name = "Kafka Clients(Producers|Consumers) Instrumentation Module"
      stoppable = true
      instrumentations = [
        "kamon.kafka.instrumentation.ProducerInstrumentation",
        "kamon.kafka.instrumentation.ConsumerInstrumentation"
      ]
      within = [
        "org.apache.kafka.clients.*",
      ]
    }
  }
}

But when I'm running the application, Kamon fails to find the instrumentation classes:

[Attach Listener] INFO 2022-08-07 19:01:30  Logger : Loading Kafka Clients(Producers|Consumers) Instrumentation Module  
[Attach Listener] INFO 2022-08-07 19:01:30  Logger :  ==> Loading kamon.kafka.instrumentation.ProducerInstrumentation  
[Attach Listener] WARNING 2022-08-07 19:01:30  Logger : Error trying to load Instrumentation: kamon.kafka.instrumentation.ProducerInstrumentation with error: java.lang.ClassNotFoundException: kamon.kafka.instrumentation.ProducerInstrumentation 
[Attach Listener] INFO 2022-08-07 19:01:30  Logger :  ==> Loading kamon.kafka.instrumentation.ConsumerInstrumentation  
[Attach Listener] WARNING 2022-08-07 19:01:30  Logger : Error trying to load Instrumentation: kamon.kafka.instrumentation.ConsumerInstrumentation with error: java.lang.ClassNotFoundException: kamon.kafka.instrumentation.ConsumerInstrumentation 
[Attach Listener] INFO 2022-08-07 19:01:30  Logger : Retransformation Strategy activated for: Kafka Clients(Producers|Consumers) Instrumentation Module 

I reloaded sbt.build, and can see kamon-kafka" % "2.5.4 in the dependencies list (in IntelliJ). What could it be?

omer
  • 1,242
  • 4
  • 18
  • 45
  • 2
    How are you running the app? Have you tried `sbt dependencyTree` to have a view of dependencies really used? – Gaël J Aug 07 '22 at 16:43
  • @GaëlJ Checked sbt dependencyTree, and kamom-kafka appears there. I ran the application as is (via IntelliJ) – omer Aug 08 '22 at 07:16

0 Answers0