Skip to content

Commit

Permalink
Only instrument the actual Spring TaskScheduler implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek committed Jun 8, 2023
1 parent 1263e47 commit 30eec01
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package io.opentelemetry.javaagent.instrumentation.spring.scheduling.v3_1;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.implementsInterface;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.namedOneOf;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
Expand All @@ -20,7 +19,10 @@
public class TaskSchedulerInstrumentation implements TypeInstrumentation {
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return implementsInterface(named("org.springframework.scheduling.TaskScheduler"));
return namedOneOf(
"org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler",
"org.springframework.scheduling.concurrent.ConcurrentTaskScheduler",
"org.springframework.scheduling.commonj.TimerManagerTaskScheduler");
}

@Override
Expand Down

0 comments on commit 30eec01

Please sign in to comment.