diff --git a/build.sbt b/build.sbt index 0918ce796..4240e0486 100644 --- a/build.sbt +++ b/build.sbt @@ -1128,7 +1128,8 @@ lazy val `kamon-bundle-dependencies-all` = (project in file("bundle/kamon-bundle `kamon-caffeine`, `kamon-lagom`, `kamon-aws-sdk`, - `kamon-apache-httpclient` + `kamon-apache-httpclient`, + `kamon-apache-cxf` ) /** @@ -1193,7 +1194,8 @@ lazy val `kamon-bundle-dependencies-3` = (project in file("bundle/kamon-bundle-d `kamon-pekko`, `kamon-pekko-http`, `kamon-pekko-grpc`, - `kamon-apache-httpclient` + `kamon-apache-httpclient`, + `kamon-apache-cxf` ) lazy val `kamon-bundle` = (project in file("bundle/kamon-bundle")) diff --git a/instrumentation/kamon-apache-cxf/src/main/scala/kamon/instrumentation/apache/cxf/client/TracingClientFeatureInitializer.scala b/instrumentation/kamon-apache-cxf/src/main/scala/kamon/instrumentation/apache/cxf/client/TracingClientFeatureInitializer.scala index ba8bc8ddc..48708862a 100644 --- a/instrumentation/kamon-apache-cxf/src/main/scala/kamon/instrumentation/apache/cxf/client/TracingClientFeatureInitializer.scala +++ b/instrumentation/kamon-apache-cxf/src/main/scala/kamon/instrumentation/apache/cxf/client/TracingClientFeatureInitializer.scala @@ -4,11 +4,13 @@ import kanela.agent.libs.net.bytebuddy.asm.Advice import kanela.agent.libs.net.bytebuddy.asm.Advice.This import org.apache.cxf.frontend.ClientProxyFactoryBean +import scala.annotation.static + class TracingClientFeatureInitializer object TracingClientFeatureInitializer { @Advice.OnMethodEnter - def onEnter(@This clientProxyFactoryBean: Any) = clientProxyFactoryBean match { + @static def onEnter(@This clientProxyFactoryBean: Any) = clientProxyFactoryBean match { case c: ClientProxyFactoryBean => c.getFeatures.add(new TracingClientFeature) } }