Kamon icon indicating copy to clipboard operation
Kamon copied to clipboard

Trying to load Akka instrumentation when using Pekko in Scala 3

Open drenizg opened this issue 11 months ago • 2 comments

Hi,

I'm moving my Pekko project to Scala 3.3.3, and when I run it, it throws this warning (Only for Scala 3; same code runs fine when compiled with Scala 2.13):

[Attach Listener] WARNING 2024-04-01 08:16:53  Logger : Error trying to load Instrumentation: kamon.instrumentation.akka.instrumentations.akka_25.DispatcherInstrumentation with error: java.lang.ClassNotFoundException: kamon.instrumentation.akka.instrumentations.akka_25.DispatcherInstrumentation 
[Attach Listener] WARNING 2024-04-01 08:16:53  Logger : Error trying to load Instrumentation: kamon.instrumentation.akka.instrumentations.akka_25.remote.RemotingInstrumentation with error: java.lang.ClassNotFoundException: kamon.instrumentation.akka.instrumentations.akka_25.remote.RemotingInstrumentation 
[2024-04-01 08:16:54,498] [INFO] [kamon.status.page.StatusPage] [] [main] - Status Page started on http://0.0.0.0:5266/ MDC: {}
[2024-04-01 08:16:54,753] [INFO] [kamon.prometheus.PrometheusReporter] [] [main] - Started the embedded HTTP server on http://0.0.0.0:9095/metrics MDC: {}
[2024-04-01 08:16:54,801] [INFO] [kamon.Init] [] [main] - 
 _
| |
| | ____ _ _ __ ___   ___  _ __
| |/ / _  |  _ ` _ \ / _ \|  _ \
|   < (_| | | | | | | (_) | | | |
|_|\_\__,_|_| |_| |_|\___/|_| |_|
=====================================
Initializing Kamon Telemetry v2.7.1 / Kanela v1.0.18
 MDC: {}

As a workaround, I successfully disabled those modules in application.conf file:

kanela.modules {
  akka.enabled = false
  akka-remote.enabled = false
}

Any ideas on why is it trying to load Akka instrumentation in a Pekko project with no Akka dependencies?

drenizg avatar Apr 01 '24 13:04 drenizg

I confirm this issue.

Dichotomia avatar Apr 04 '24 21:04 Dichotomia

I'm guessing you're using the kamon-bundle dependency? I think this is because the kamon-akka reference.conf has these lines:

      "kamon.instrumentation.akka.instrumentations.akka_25.DispatcherInstrumentation",
      "kamon.instrumentation.akka.instrumentations.akka_26.DispatcherInstrumentation",

and

      "kamon.instrumentation.akka.instrumentations.akka_25.remote.RemotingInstrumentation",
      "kamon.instrumentation.akka.instrumentations.akka_26.remote.RemotingInstrumentation"

but the akka 2.5 instrumentation is not in the kamon-bundle for scala 3 (because there is no akka 2.5 for scala 3). The reverse is true for scala 2.11, there is no akka 2.6 instrumentation for scala 2.11 (because there is no akka 2.6 for scala 2.11)

Maybe scala 2.11 and akka 2.5 could be dropped.

Philippus avatar Sep 09 '24 20:09 Philippus