Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only instrument the actual Spring TaskScheduler implementations #8676

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,12 @@
public class TaskSchedulerInstrumentation implements TypeInstrumentation {
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return implementsInterface(named("org.springframework.scheduling.TaskScheduler"));
// we're only instrumenting the "real" scheduler implementations, and skipping all the decorator
// impls
return namedOneOf(
"org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler",
"org.springframework.scheduling.concurrent.ConcurrentTaskScheduler",
"org.springframework.scheduling.commonj.TimerManagerTaskScheduler");
mateuszrzeszutek marked this conversation as resolved.
Show resolved Hide resolved
}

@Override
Expand Down