Skip to content

Commit 54f795e

Browse files
committed
Ensure ClassloadingInstrumentation is always applied even with DD_TRACE_ENABLED=false
This avoids potential class-loading delegation issues when using other products in dd-java-agent
1 parent 8fc90d5 commit 54f795e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dd-java-agent/instrumentation/classloading/src/main/java/datadog/trace/instrumentation/classloading/ClassloadingInstrumentation.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import datadog.trace.agent.tooling.InstrumenterModule;
1717
import datadog.trace.bootstrap.CallDepthThreadLocalMap;
1818
import datadog.trace.bootstrap.Constants;
19+
import java.util.Set;
1920
import net.bytebuddy.asm.Advice;
2021
import net.bytebuddy.description.type.TypeDescription;
2122
import net.bytebuddy.matcher.ElementMatcher;
@@ -31,14 +32,19 @@
3132
* for the classes that we have put in the bootstrap class loader.
3233
*/
3334
@AutoService(InstrumenterModule.class)
34-
public final class ClassloadingInstrumentation extends InstrumenterModule.Tracing
35+
public final class ClassloadingInstrumentation extends InstrumenterModule
3536
implements Instrumenter.ForBootstrap,
3637
Instrumenter.ForTypeHierarchy,
3738
Instrumenter.HasMethodAdvice {
3839
public ClassloadingInstrumentation() {
3940
super("classloading");
4041
}
4142

43+
@Override
44+
public boolean isApplicable(Set<TargetSystem> enabledSystems) {
45+
return true;
46+
}
47+
4248
@Override
4349
protected boolean defaultEnabled() {
4450
return true;

0 commit comments

Comments
 (0)