diff --git a/instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/instrumentations/DispatcherInstrumentation.scala b/instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/instrumentations/DispatcherInstrumentation.scala index b2c3a7454..4607473e3 100644 --- a/instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/instrumentations/DispatcherInstrumentation.scala +++ b/instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/instrumentations/DispatcherInstrumentation.scala @@ -127,16 +127,16 @@ object InstrumentNewExecutorServiceOnPekko { @SuperCall callable: Callable[ExecutorService] ): ExecutorService = { val executor = callable.call() - val actorSystemName = if (factory.dispatcherPrerequisites != null) { - factory.dispatcherPrerequisites.settings.name - } else { - "unknown" - } val dispatcherName = factory.dispatcherName - val scheduledActionName = actorSystemName + "/" + dispatcherName - val systemTags = TagSet.of("pekko.system", actorSystemName) if (Kamon.filter(PekkoInstrumentation.TrackDispatcherFilterName).accept(dispatcherName)) { + val actorSystemName = if (factory.dispatcherPrerequisites != null) { + factory.dispatcherPrerequisites.settings.name + } else { + "unknown" + } + val scheduledActionName = actorSystemName + "/" + dispatcherName + val systemTags = TagSet.of("pekko.system", actorSystemName) val defaultEcOption = Option(factory.dispatcherPrerequisites) .flatMap(_.defaultExecutionContext)