diff --git a/instrumentation/spring/spring-scheduling-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/TaskSchedulerInstrumentation.java b/instrumentation/spring/spring-scheduling-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/TaskSchedulerInstrumentation.java index 6afedd9ceece..412df1b56ea4 100644 --- a/instrumentation/spring/spring-scheduling-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/TaskSchedulerInstrumentation.java +++ b/instrumentation/spring/spring-scheduling-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/TaskSchedulerInstrumentation.java @@ -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; @@ -20,7 +19,10 @@ public class TaskSchedulerInstrumentation implements TypeInstrumentation { @Override public ElementMatcher 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