From 1212250d9f72f7721a1902e8c25a46201477aa49 Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Mon, 27 Jun 2022 19:51:42 +0200 Subject: [PATCH] use Play Environment's classloader when creating Kamon-related objects (#1185) --- .../src/main/scala/kamon/instrumentation/play/GuiceModule.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instrumentation/kamon-play/src/main/scala/kamon/instrumentation/play/GuiceModule.scala b/instrumentation/kamon-play/src/main/scala/kamon/instrumentation/play/GuiceModule.scala index 447a4eb3a..2fd244b34 100644 --- a/instrumentation/kamon-play/src/main/scala/kamon/instrumentation/play/GuiceModule.scala +++ b/instrumentation/kamon-play/src/main/scala/kamon/instrumentation/play/GuiceModule.scala @@ -36,6 +36,8 @@ object GuiceModule { Logger(classOf[KamonLoader]).info("Reconfiguring Kamon with Play's Config") Logger(classOf[KamonLoader]).info(configuration.underlying.getString("play.server.provider")) Logger(classOf[KamonLoader]).info(configuration.underlying.getString("kamon.trace.tick-interval")) + + kamon.ClassLoading.changeClassLoader(environment.classLoader) Kamon.initWithoutAttaching(configuration.underlying) lifecycle.addStopHook { () =>