Skip to content

Commit a8b9931

Browse files
authored
Merge branch 'master' into pekko_1.1
2 parents 6ce7303 + a478d3b commit a8b9931

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/instrumentations/DispatcherInstrumentation.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,18 @@ object InstrumentNewExecutorServiceOnPekko {
128128
@SuperCall callable: Callable[ExecutorService]
129129
): ExecutorService = {
130130
val executor = callable.call()
131-
if (factory.dispatcherPrerequisites == null)
132-
println(s"Failed to find dispatcherPrerequisites on ${factory.getClass}:: $factory")
133-
val actorSystemName = Option(factory.dispatcherPrerequisites).map(_.settings.name).getOrElse("--unknown actor--")
131+
val actorSystemName = if (factory.dispatcherPrerequisites != null) {
132+
factory.dispatcherPrerequisites.settings.name
133+
} else {
134+
"unknown"
135+
}
134136
val dispatcherName = factory.dispatcherName
135137
val scheduledActionName = actorSystemName + "/" + dispatcherName
136138
val systemTags = TagSet.of("pekko.system", actorSystemName)
137139

138140
if (Kamon.filter(PekkoInstrumentation.TrackDispatcherFilterName).accept(dispatcherName)) {
139-
val defaultEcOption = Option(factory.dispatcherPrerequisites).flatMap(_.defaultExecutionContext)
141+
val defaultEcOption = Option(factory.dispatcherPrerequisites)
142+
.flatMap(_.defaultExecutionContext)
140143

141144
if (dispatcherName == Dispatchers.DefaultDispatcherId && defaultEcOption.isDefined) {
142145
ExecutorInstrumentation.instrumentExecutionContext(

0 commit comments

Comments
 (0)