Merge branch 'master' into mar-kolya/constantify-decorator-matcher
This commit is contained in:
commit
0b196ed3ec
|
@ -1,4 +1,4 @@
|
|||
### Contributing
|
||||
## Contributing
|
||||
|
||||
Pull requests for bug fixes are welcome, but before submitting new features or changes to current functionality [open an issue](https://github.com/DataDog/dd-trace-java/issues/new)
|
||||
and discuss your ideas or propose the changes you wish to make. After a resolution is reached a PR can be submitted for review.
|
||||
|
@ -15,7 +15,14 @@ Java files must be formatted using [google-java-format](https://github.com/googl
|
|||
|
||||
Other source files (Groovy, Scala, etc) should ideally be formatted by Intellij Idea's default formatting, but are not enforced.
|
||||
|
||||
### Intellij Idea
|
||||
### Intellij IDEA
|
||||
|
||||
Compiler settings:
|
||||
* OpenJDK 11 must be installed to build the entire project. Under `SDKs` it must have the name `11`.
|
||||
* Under `Build, Execution, Deployment > Compiler > Java Compiler` disable `Use '--release' option for cross-compilation`
|
||||
|
||||
Required plugins:
|
||||
* [Lombok](https://plugins.jetbrains.com/plugin/6317-lombok-plugin)
|
||||
|
||||
Suggested plugins and settings:
|
||||
|
||||
|
@ -25,6 +32,5 @@ Suggested plugins and settings:
|
|||
* With java use the following import layout (groovy should still use the default) to ensure consistency with google-java-format:
|
||||

|
||||
* [Google Java Format](https://plugins.jetbrains.com/plugin/8527-google-java-format)
|
||||
* [Lombok](https://plugins.jetbrains.com/plugin/6317-lombok-plugin)
|
||||
* [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions)
|
||||

|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
package datadog.trace.agent.tooling;
|
||||
|
||||
import static datadog.trace.bootstrap.WeakMap.Provider.newWeakMap;
|
||||
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import datadog.trace.bootstrap.PatchLogger;
|
||||
import datadog.trace.bootstrap.WeakMap;
|
||||
import io.opentracing.util.GlobalTracer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
@Slf4j
|
||||
public class ClassLoaderMatcher {
|
||||
public final class ClassLoaderMatcher {
|
||||
public static final ClassLoader BOOTSTRAP_CLASSLOADER = null;
|
||||
public static final int CACHE_CONCURRENCY =
|
||||
Math.max(8, Runtime.getRuntime().availableProcessors());
|
||||
|
||||
/** A private constructor that must not be invoked. */
|
||||
private ClassLoaderMatcher() {
|
||||
|
@ -21,32 +22,38 @@ public class ClassLoaderMatcher {
|
|||
return SkipClassLoaderMatcher.INSTANCE;
|
||||
}
|
||||
|
||||
public static ElementMatcher.Junction.AbstractBase<ClassLoader> classLoaderHasClasses(
|
||||
final String... names) {
|
||||
return new ClassLoaderHasClassMatcher(names);
|
||||
public static ElementMatcher.Junction.AbstractBase<ClassLoader> classLoaderHasNoResources(
|
||||
final String... resources) {
|
||||
return new ClassLoaderHasNoResourceMatcher(resources);
|
||||
}
|
||||
|
||||
private static class SkipClassLoaderMatcher
|
||||
extends ElementMatcher.Junction.AbstractBase<ClassLoader>
|
||||
implements WeakMap.ValueSupplier<ClassLoader, Boolean> {
|
||||
private static final class SkipClassLoaderMatcher
|
||||
extends ElementMatcher.Junction.AbstractBase<ClassLoader> {
|
||||
public static final SkipClassLoaderMatcher INSTANCE = new SkipClassLoaderMatcher();
|
||||
/* Cache of classloader-instance -> (true|false). True = skip instrumentation. False = safe to instrument. */
|
||||
private static final WeakMap<ClassLoader, Boolean> SKIP_CACHE = newWeakMap();
|
||||
private static final Cache<ClassLoader, Boolean> skipCache =
|
||||
CacheBuilder.newBuilder().weakKeys().concurrencyLevel(CACHE_CONCURRENCY).build();
|
||||
private static final String DATADOG_CLASSLOADER_NAME =
|
||||
"datadog.trace.bootstrap.DatadogClassLoader";
|
||||
|
||||
private SkipClassLoaderMatcher() {}
|
||||
|
||||
@Override
|
||||
public boolean matches(final ClassLoader target) {
|
||||
if (target == BOOTSTRAP_CLASSLOADER) {
|
||||
public boolean matches(final ClassLoader cl) {
|
||||
if (cl == BOOTSTRAP_CLASSLOADER) {
|
||||
// Don't skip bootstrap loader
|
||||
return false;
|
||||
}
|
||||
return shouldSkipClass(target) || shouldSkipInstance(target);
|
||||
Boolean v = skipCache.getIfPresent(cl);
|
||||
if (v != null) {
|
||||
return v;
|
||||
}
|
||||
v = shouldSkipClass(cl) || !delegatesToBootstrap(cl);
|
||||
skipCache.put(cl, v);
|
||||
return v;
|
||||
}
|
||||
|
||||
private boolean shouldSkipClass(final ClassLoader loader) {
|
||||
private static boolean shouldSkipClass(final ClassLoader loader) {
|
||||
switch (loader.getClass().getName()) {
|
||||
case "org.codehaus.groovy.runtime.callsite.CallSiteClassLoader":
|
||||
case "sun.reflect.DelegatingClassLoader":
|
||||
|
@ -60,28 +67,13 @@ public class ClassLoaderMatcher {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean shouldSkipInstance(final ClassLoader loader) {
|
||||
return SKIP_CACHE.computeIfAbsent(loader, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean get(final ClassLoader loader) {
|
||||
final boolean skip = !delegatesToBootstrap(loader);
|
||||
if (skip) {
|
||||
log.debug(
|
||||
"skipping classloader instance {} of type {}", loader, loader.getClass().getName());
|
||||
}
|
||||
|
||||
return skip;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: this turns out to be useless with OSGi: {@code
|
||||
* org.eclipse.osgi.internal.loader.BundleLoader#isRequestFromVM} returns {@code true} when
|
||||
* class loading is issued from this check and {@code false} for 'real' class loads. We should
|
||||
* come up with some sort of hack to avoid this problem.
|
||||
*/
|
||||
private boolean delegatesToBootstrap(final ClassLoader loader) {
|
||||
private static boolean delegatesToBootstrap(final ClassLoader loader) {
|
||||
boolean delegates = true;
|
||||
if (!loadsExpectedClass(loader, GlobalTracer.class)) {
|
||||
log.debug("loader {} failed to delegate bootstrap opentracing class", loader);
|
||||
|
@ -94,7 +86,8 @@ public class ClassLoaderMatcher {
|
|||
return delegates;
|
||||
}
|
||||
|
||||
private boolean loadsExpectedClass(final ClassLoader loader, final Class<?> expectedClass) {
|
||||
private static boolean loadsExpectedClass(
|
||||
final ClassLoader loader, final Class<?> expectedClass) {
|
||||
try {
|
||||
return loader.loadClass(expectedClass.getName()) == expectedClass;
|
||||
} catch (final ClassNotFoundException e) {
|
||||
|
@ -103,36 +96,38 @@ public class ClassLoaderMatcher {
|
|||
}
|
||||
}
|
||||
|
||||
public static class ClassLoaderHasClassMatcher
|
||||
extends ElementMatcher.Junction.AbstractBase<ClassLoader>
|
||||
implements WeakMap.ValueSupplier<ClassLoader, Boolean> {
|
||||
private static class ClassLoaderHasNoResourceMatcher
|
||||
extends ElementMatcher.Junction.AbstractBase<ClassLoader> {
|
||||
private final Cache<ClassLoader, Boolean> cache =
|
||||
CacheBuilder.newBuilder().weakKeys().concurrencyLevel(CACHE_CONCURRENCY).build();
|
||||
|
||||
private final WeakMap<ClassLoader, Boolean> cache = newWeakMap();
|
||||
private final String[] resources;
|
||||
|
||||
private final String[] names;
|
||||
|
||||
private ClassLoaderHasClassMatcher(final String... names) {
|
||||
this.names = names;
|
||||
private ClassLoaderHasNoResourceMatcher(final String... resources) {
|
||||
this.resources = resources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final ClassLoader target) {
|
||||
if (target != null) {
|
||||
return cache.computeIfAbsent(target, this);
|
||||
private boolean hasNoResources(ClassLoader cl) {
|
||||
for (final String resource : resources) {
|
||||
if (cl.getResource(resource) == null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean get(final ClassLoader target) {
|
||||
for (final String name : names) {
|
||||
if (target.getResource(Utils.getResourceName(name)) == null) {
|
||||
return false;
|
||||
}
|
||||
public boolean matches(final ClassLoader cl) {
|
||||
if (cl == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
Boolean v = cache.getIfPresent(cl);
|
||||
if (v != null) {
|
||||
return v;
|
||||
}
|
||||
v = hasNoResources(cl);
|
||||
cache.put(cl, v);
|
||||
return v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,11 @@ import com.google.common.cache.Cache;
|
|||
import com.google.common.cache.CacheBuilder;
|
||||
import java.lang.ref.WeakReference;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.description.annotation.AnnotationList;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.description.method.MethodList;
|
||||
import net.bytebuddy.description.type.TypeDescription;
|
||||
import net.bytebuddy.description.type.TypeList;
|
||||
import net.bytebuddy.dynamic.ClassFileLocator;
|
||||
import net.bytebuddy.pool.TypePool;
|
||||
|
||||
|
@ -93,12 +97,12 @@ public class DDCachingPoolStrategy implements PoolStrategy {
|
|||
return createCachingTypePool(loaderHash, loaderRef, classFileLocator);
|
||||
}
|
||||
|
||||
private final TypePool.CacheProvider createCacheProvider(
|
||||
private TypePool.CacheProvider createCacheProvider(
|
||||
final int loaderHash, final WeakReference<ClassLoader> loaderRef) {
|
||||
return new SharedResolutionCacheAdapter(loaderHash, loaderRef, sharedResolutionCache);
|
||||
}
|
||||
|
||||
private final TypePool createCachingTypePool(
|
||||
private TypePool createCachingTypePool(
|
||||
final int loaderHash,
|
||||
final WeakReference<ClassLoader> loaderRef,
|
||||
final ClassFileLocator classFileLocator) {
|
||||
|
@ -108,7 +112,7 @@ public class DDCachingPoolStrategy implements PoolStrategy {
|
|||
TypePool.Default.ReaderMode.FAST);
|
||||
}
|
||||
|
||||
private final TypePool createCachingTypePool(
|
||||
private TypePool createCachingTypePool(
|
||||
final TypePool.CacheProvider cacheProvider, final ClassFileLocator classFileLocator) {
|
||||
return new TypePool.Default.WithLazyResolution(
|
||||
cacheProvider, classFileLocator, TypePool.Default.ReaderMode.FAST);
|
||||
|
@ -197,7 +201,7 @@ public class DDCachingPoolStrategy implements PoolStrategy {
|
|||
static final class SharedResolutionCacheAdapter implements TypePool.CacheProvider {
|
||||
private static final String OBJECT_NAME = "java.lang.Object";
|
||||
private static final TypePool.Resolution OBJECT_RESOLUTION =
|
||||
new TypePool.Resolution.Simple(TypeDescription.OBJECT);
|
||||
new TypePool.Resolution.Simple(new CachingTypeDescription(TypeDescription.OBJECT));
|
||||
|
||||
private final int loaderHash;
|
||||
private final WeakReference<ClassLoader> loaderRef;
|
||||
|
@ -228,12 +232,13 @@ public class DDCachingPoolStrategy implements PoolStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TypePool.Resolution register(
|
||||
final String className, final TypePool.Resolution resolution) {
|
||||
public TypePool.Resolution register(final String className, TypePool.Resolution resolution) {
|
||||
if (OBJECT_NAME.equals(className)) {
|
||||
return resolution;
|
||||
}
|
||||
|
||||
resolution = new CachingResolution(resolution);
|
||||
|
||||
sharedResolutionCache.put(new TypeCacheKey(loaderHash, loaderRef, className), resolution);
|
||||
return resolution;
|
||||
}
|
||||
|
@ -243,4 +248,90 @@ public class DDCachingPoolStrategy implements PoolStrategy {
|
|||
// Allowing the high-level eviction policy make the clearing decisions
|
||||
}
|
||||
}
|
||||
|
||||
private static class CachingResolution implements TypePool.Resolution {
|
||||
private final TypePool.Resolution delegate;
|
||||
private TypeDescription cachedResolution;
|
||||
|
||||
public CachingResolution(final TypePool.Resolution delegate) {
|
||||
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isResolved() {
|
||||
return delegate.isResolved();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeDescription resolve() {
|
||||
// Intentionally not "thread safe". Duplicate work deemed an acceptable trade-off.
|
||||
if (cachedResolution == null) {
|
||||
cachedResolution = new CachingTypeDescription(delegate.resolve());
|
||||
}
|
||||
return cachedResolution;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TypeDescription implementation that delegates and caches the results for the expensive calls
|
||||
* commonly used by our instrumentation.
|
||||
*/
|
||||
private static class CachingTypeDescription
|
||||
extends TypeDescription.AbstractBase.OfSimpleType.WithDelegation {
|
||||
private final TypeDescription delegate;
|
||||
|
||||
// These fields are intentionally not "thread safe".
|
||||
// Duplicate work deemed an acceptable trade-off.
|
||||
private Generic superClass;
|
||||
private TypeList.Generic interfaces;
|
||||
private AnnotationList annotations;
|
||||
private MethodList<MethodDescription.InDefinedShape> methods;
|
||||
|
||||
public CachingTypeDescription(final TypeDescription delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TypeDescription delegate() {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Generic getSuperClass() {
|
||||
if (superClass == null) {
|
||||
superClass = delegate.getSuperClass();
|
||||
}
|
||||
return superClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeList.Generic getInterfaces() {
|
||||
if (interfaces == null) {
|
||||
interfaces = delegate.getInterfaces();
|
||||
}
|
||||
return interfaces;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnnotationList getDeclaredAnnotations() {
|
||||
if (annotations == null) {
|
||||
annotations = delegate.getDeclaredAnnotations();
|
||||
}
|
||||
return annotations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodList<MethodDescription.InDefinedShape> getDeclaredMethods() {
|
||||
if (methods == null) {
|
||||
methods = delegate.getDeclaredMethods();
|
||||
}
|
||||
return methods;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return delegate.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,42 @@ public class GlobalIgnoresMatcher<T extends TypeDescription>
|
|||
|| name.startsWith("com.singularity.")
|
||||
|| name.startsWith("com.jinspired.")
|
||||
|| name.startsWith("org.jinspired.")
|
||||
|| name.startsWith("org.springframework.cglib.")) {
|
||||
|| name.startsWith("org.springframework.cglib.")
|
||||
|| name.startsWith("org.springframework.aop.")
|
||||
|| name.startsWith("org.springframework.beans.factory.annotation.")
|
||||
|| name.startsWith("org.springframework.beans.factory.config.")
|
||||
|| name.startsWith("org.springframework.beans.factory.parsing.")
|
||||
|| name.startsWith("org.springframework.beans.factory.xml.")
|
||||
|| name.startsWith("org.springframework.beans.propertyeditors.")
|
||||
|| name.startsWith("org.springframework.boot.autoconfigure.cache.")
|
||||
|| name.startsWith("org.springframework.boot.autoconfigure.condition.")
|
||||
|| name.startsWith("org.springframework.boot.autoconfigure.http.")
|
||||
|| name.startsWith("org.springframework.boot.autoconfigure.jackson.")
|
||||
|| name.startsWith("org.springframework.boot.autoconfigure.web.")
|
||||
|| name.startsWith("org.springframework.boot.context.")
|
||||
|| name.startsWith("org.springframework.boot.convert.")
|
||||
|| name.startsWith("org.springframework.boot.diagnostics.")
|
||||
|| name.startsWith("org.springframework.boot.web.server.")
|
||||
|| name.startsWith("org.springframework.boot.web.servlet.")
|
||||
|| name.startsWith("org.springframework.context.annotation.")
|
||||
|| name.startsWith("org.springframework.context.event.")
|
||||
|| name.startsWith("org.springframework.context.expression.")
|
||||
|| name.startsWith("org.springframework.core.annotation.")
|
||||
|| name.startsWith("org.springframework.core.convert.")
|
||||
|| name.startsWith("org.springframework.core.env.")
|
||||
|| name.startsWith("org.springframework.core.io.")
|
||||
|| name.startsWith("org.springframework.core.type.")
|
||||
|| name.startsWith("org.springframework.expression.")
|
||||
|| name.startsWith("org.springframework.format.")
|
||||
|| name.startsWith("org.springframework.http.")
|
||||
|| name.startsWith("org.springframework.ui.")
|
||||
|| name.startsWith("org.springframework.validation.")
|
||||
|| name.startsWith("org.springframework.web.context.")
|
||||
|| name.startsWith("org.springframework.web.filter.")
|
||||
|| name.startsWith("org.springframework.web.method.")
|
||||
|| name.startsWith("org.springframework.web.multipart.")
|
||||
|| name.startsWith("org.springframework.web.util.")) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package datadog.trace.agent.tooling.bytebuddy.matcher;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.description.type.TypeDefinition;
|
||||
import net.bytebuddy.description.type.TypeDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import net.bytebuddy.matcher.ElementMatchers;
|
||||
|
||||
/**
|
||||
* This class provides some custom ByteBuddy element matchers to use when applying instrumentation
|
||||
|
@ -15,7 +17,13 @@ public class DDElementMatchers {
|
|||
|
||||
public static <T extends TypeDescription> ElementMatcher.Junction<T> extendsClass(
|
||||
final ElementMatcher<? super TypeDescription> matcher) {
|
||||
return new SafeExtendsClassMatcher<>(new SafeErasureMatcher<>(matcher));
|
||||
return not(isInterface()).and(new SafeExtendsClassMatcher<>(new SafeErasureMatcher<>(matcher)));
|
||||
}
|
||||
|
||||
public static <T extends TypeDescription> ElementMatcher.Junction<T> implementsInterface(
|
||||
final ElementMatcher<? super TypeDescription> matcher) {
|
||||
return not(isInterface())
|
||||
.and(new SafeHasSuperTypeMatcher<>(new SafeErasureMatcher<>(matcher), true));
|
||||
}
|
||||
|
||||
public static <T extends TypeDescription> ElementMatcher.Junction<T> hasInterface(
|
||||
|
@ -23,20 +31,12 @@ public class DDElementMatchers {
|
|||
return new SafeHasSuperTypeMatcher<>(new SafeErasureMatcher<>(matcher), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Matches any type description that declares a super type that matches the provided matcher.
|
||||
* Exceptions during matching process are logged and ignored.
|
||||
*
|
||||
* @param matcher The type to be checked for being a super type of the matched type.
|
||||
* @param <T> The type of the matched object.
|
||||
* @return A matcher that matches any type description that declares a super type that matches the
|
||||
* provided matcher.
|
||||
* @see ElementMatchers#hasSuperType(net.bytebuddy.matcher.ElementMatcher)
|
||||
*/
|
||||
public static <T extends TypeDescription> ElementMatcher.Junction<T> safeHasSuperType(
|
||||
final ElementMatcher<? super TypeDescription> matcher) {
|
||||
return new SafeHasSuperTypeMatcher<>(new SafeErasureMatcher<>(matcher), false);
|
||||
return not(isInterface())
|
||||
.and(new SafeHasSuperTypeMatcher<>(new SafeErasureMatcher<>(matcher), false));
|
||||
}
|
||||
|
||||
// TODO: add javadoc
|
||||
public static <T extends MethodDescription> ElementMatcher.Junction<T> hasSuperMethod(
|
||||
final ElementMatcher<? super MethodDescription> matcher) {
|
||||
|
|
|
@ -4,7 +4,6 @@ import static datadog.trace.agent.tooling.ClassLoaderMatcher.BOOTSTRAP_CLASSLOAD
|
|||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.safeHasSuperType;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import datadog.trace.agent.tooling.HelperInjector;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -354,9 +353,7 @@ public class FieldBackedProvider implements InstrumentationContextProvider {
|
|||
*/
|
||||
builder =
|
||||
builder
|
||||
.type(
|
||||
not(isInterface()).and(safeHasSuperType(named(entry.getKey()))),
|
||||
instrumenter.classLoaderMatcher())
|
||||
.type(safeHasSuperType(named(entry.getKey())), instrumenter.classLoaderMatcher())
|
||||
.and(safeToInjectFieldsMatcher())
|
||||
.and(Default.NOT_DECORATOR_MATCHER)
|
||||
.transform(AgentBuilder.Transformer.NoOp.INSTANCE);
|
||||
|
|
|
@ -6,11 +6,12 @@ import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.F
|
|||
import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.G
|
||||
import datadog.trace.util.test.DDSpecification
|
||||
import net.bytebuddy.description.type.TypeDescription
|
||||
import net.bytebuddy.jar.asm.Opcodes
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.extendsClass
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named
|
||||
|
||||
class SafeExtendsClassMatcherTest extends DDSpecification {
|
||||
class ExtendsClassMatcherTest extends DDSpecification {
|
||||
|
||||
def "test matcher #matcherClass.simpleName -> #type.simpleName"() {
|
||||
expect:
|
||||
|
@ -40,6 +41,7 @@ class SafeExtendsClassMatcherTest extends DDSpecification {
|
|||
then:
|
||||
!result // default to false
|
||||
noExceptionThrown()
|
||||
1 * type.getModifiers() >> Opcodes.ACC_ABSTRACT
|
||||
1 * type.asGenericType() >> typeGeneric
|
||||
1 * type.getTypeName() >> "type-name"
|
||||
1 * typeGeneric.asErasure() >> { throw new Exception("asErasure exception") }
|
|
@ -7,11 +7,13 @@ import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.F
|
|||
import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.G
|
||||
import datadog.trace.util.test.DDSpecification
|
||||
import net.bytebuddy.description.type.TypeDescription
|
||||
import net.bytebuddy.jar.asm.Opcodes
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named
|
||||
|
||||
class SafeHasInterfaceMatcherTest extends DDSpecification {
|
||||
class HasInterfaceMatcherTest extends DDSpecification {
|
||||
|
||||
def "test matcher #matcherClass.simpleName -> #type.simpleName"() {
|
||||
expect:
|
||||
|
@ -24,6 +26,7 @@ class SafeHasInterfaceMatcherTest extends DDSpecification {
|
|||
B | A | false
|
||||
A | E | true
|
||||
A | F | true
|
||||
A | G | true
|
||||
F | A | false
|
||||
F | F | false
|
||||
F | G | false
|
||||
|
@ -36,7 +39,7 @@ class SafeHasInterfaceMatcherTest extends DDSpecification {
|
|||
setup:
|
||||
def type = Mock(TypeDescription)
|
||||
def typeGeneric = Mock(TypeDescription.Generic)
|
||||
def matcher = hasInterface(named(Object.name))
|
||||
def matcher = implementsInterface(named(Object.name))
|
||||
|
||||
when:
|
||||
def result = matcher.matches(type)
|
||||
|
@ -44,6 +47,7 @@ class SafeHasInterfaceMatcherTest extends DDSpecification {
|
|||
then:
|
||||
!result // default to false
|
||||
noExceptionThrown()
|
||||
1 * type.getModifiers() >> Opcodes.ACC_ABSTRACT
|
||||
1 * type.isInterface() >> true
|
||||
1 * type.asGenericType() >> typeGeneric
|
||||
1 * typeGeneric.asErasure() >> { throw new Exception("asErasure exception") }
|
|
@ -0,0 +1,59 @@
|
|||
package datadog.trace.agent.tooling.bytebuddy.matcher
|
||||
|
||||
import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.A
|
||||
import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.B
|
||||
import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.E
|
||||
import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.F
|
||||
import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.G
|
||||
import datadog.trace.util.test.DDSpecification
|
||||
import net.bytebuddy.description.type.TypeDescription
|
||||
import net.bytebuddy.jar.asm.Opcodes
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named
|
||||
|
||||
class ImplementsInterfaceMatcherTest extends DDSpecification {
|
||||
|
||||
def "test matcher #matcherClass.simpleName -> #type.simpleName"() {
|
||||
expect:
|
||||
implementsInterface(matcher).matches(argument) == result
|
||||
|
||||
where:
|
||||
matcherClass | type | result
|
||||
A | A | false
|
||||
A | B | false
|
||||
B | A | false
|
||||
A | E | false
|
||||
A | F | true
|
||||
A | G | true
|
||||
F | A | false
|
||||
F | F | false
|
||||
F | G | false
|
||||
|
||||
matcher = named(matcherClass.name)
|
||||
argument = TypeDescription.ForLoadedType.of(type)
|
||||
}
|
||||
|
||||
def "test traversal exceptions"() {
|
||||
setup:
|
||||
def type = Mock(TypeDescription)
|
||||
def typeGeneric = Mock(TypeDescription.Generic)
|
||||
def matcher = implementsInterface(named(Object.name))
|
||||
|
||||
when:
|
||||
def result = matcher.matches(type)
|
||||
|
||||
then:
|
||||
!result // default to false
|
||||
noExceptionThrown()
|
||||
1 * type.getModifiers() >> Opcodes.ACC_ABSTRACT
|
||||
1 * type.isInterface() >> true
|
||||
1 * type.asGenericType() >> typeGeneric
|
||||
1 * typeGeneric.asErasure() >> { throw new Exception("asErasure exception") }
|
||||
1 * typeGeneric.getTypeName() >> "typeGeneric-name"
|
||||
1 * type.getInterfaces() >> { throw new Exception("getInterfaces exception") }
|
||||
1 * type.getSuperClass() >> { throw new Exception("getSuperClass exception") }
|
||||
2 * type.getTypeName() >> "type-name"
|
||||
0 * _
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.F
|
|||
import datadog.trace.agent.tooling.bytebuddy.matcher.testclasses.G
|
||||
import datadog.trace.util.test.DDSpecification
|
||||
import net.bytebuddy.description.type.TypeDescription
|
||||
import net.bytebuddy.jar.asm.Opcodes
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.safeHasSuperType
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named
|
||||
|
@ -19,11 +20,12 @@ class SafeHasSuperTypeMatcherTest extends DDSpecification {
|
|||
|
||||
where:
|
||||
matcherClass | type | result
|
||||
A | A | true
|
||||
A | B | true
|
||||
A | A | false
|
||||
A | B | false
|
||||
B | A | false
|
||||
A | E | true
|
||||
A | E | false
|
||||
A | F | true
|
||||
B | G | true
|
||||
F | A | false
|
||||
F | F | true
|
||||
F | G | true
|
||||
|
@ -44,6 +46,7 @@ class SafeHasSuperTypeMatcherTest extends DDSpecification {
|
|||
then:
|
||||
!result // default to false
|
||||
noExceptionThrown()
|
||||
1 * type.getModifiers() >> Opcodes.ACC_ABSTRACT
|
||||
1 * type.asGenericType() >> typeGeneric
|
||||
1 * typeGeneric.asErasure() >> { throw new Exception("asErasure exception") }
|
||||
1 * typeGeneric.getTypeName() >> "typeGeneric-name"
|
||||
|
|
|
@ -10,14 +10,14 @@ dependencies {
|
|||
}
|
||||
|
||||
jmh {
|
||||
timeUnit = 'us' // Output time unit. Available time units are: [m, s, ms, us, ns].
|
||||
timeUnit = 'ms' // Output time unit. Available time units are: [m, s, ms, us, ns].
|
||||
benchmarkMode = ['avgt']
|
||||
timeOnIteration = '20s'
|
||||
iterations = 1 // Number of measurement iterations to do.
|
||||
fork = 1 // How many times to forks a single benchmark. Use 0 to disable forking altogether
|
||||
jvmArgs = ["-Ddd.jmxfetch.enabled=false", "-Ddd.writer.type=LoggingWriter"]
|
||||
// jvmArgs += ["-XX:+UnlockDiagnosticVMOptions", "-XX:+DebugNonSafepoints", "-XX:StartFlightRecording=delay=5s,dumponexit=true,name=jmh-benchmark,filename=${rootDir}/dd-java-agent/benchmark/build/reports/jmh/jmh-benchmark.jfr"]
|
||||
// jvmArgs += ["-agentpath:${rootDir}/dd-java-agent/benchmark/src/jmh/resources/libasyncProfiler.so=start,collapsed,file=${rootDir}/dd-java-agent/benchmark/build/reports/jmh/profiler.txt"]
|
||||
// jvmArgs += ["-agentpath:${rootDir}/dd-java-agent/benchmark/src/jmh/resources/libasyncProfiler.so=start,collapsed,file=${rootDir}/dd-java-agent/benchmark/build/reports/jmh/profiler.txt".toString()]
|
||||
failOnError = true // Should JMH fail immediately if any benchmark had experienced the unrecoverable error?
|
||||
warmup = '5s' // Time to spend at each warmup iteration.
|
||||
// warmupBatchSize = 10 // Warmup batch size: number of benchmark method calls per operation.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.apachehttpasyncclient;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeScope;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
|
@ -40,7 +40,7 @@ public class ApacheHttpAsyncClientInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return hasInterface(named("org.apache.http.nio.client.HttpAsyncClient"));
|
||||
return implementsInterface(named("org.apache.http.nio.client.HttpAsyncClient"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.apachehttpasyncclient;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
@ -31,7 +31,7 @@ public class ApacheHttpClientRedirectInstrumentation extends Instrumenter.Defaul
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return hasInterface(named("org.apache.http.client.RedirectStrategy"));
|
||||
return implementsInterface(named("org.apache.http.client.RedirectStrategy"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package datadog.trace.instrumentation.apachehttpclient;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.apachehttpclient.ApacheHttpClientDecorator.DECORATE;
|
||||
import static datadog.trace.instrumentation.apachehttpclient.HttpHeadersInjectAdapter.SETTER;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
@ -44,7 +43,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.apache.http.client.HttpClient")));
|
||||
return implementsInterface(named("org.apache.http.client.HttpClient"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,6 @@ import datadog.trace.api.DDTags;
|
|||
import datadog.trace.bootstrap.ContextStore;
|
||||
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
|
@ -102,8 +101,8 @@ public class AwsSdkClientDecorator extends HttpClientDecorator<Request, Response
|
|||
}
|
||||
|
||||
@Override
|
||||
protected URI url(final Request request) throws URISyntaxException {
|
||||
return new URI(request.getEndpoint().toString());
|
||||
protected URI url(final Request request) {
|
||||
return request.getEndpoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package datadog.trace.instrumentation.aws.v2;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -25,8 +23,9 @@ public final class AwsClientInstrumentation extends AbstractAwsClientInstrumenta
|
|||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return nameStartsWith("software.amazon.awssdk.")
|
||||
.and(not(isInterface()))
|
||||
.and(hasInterface(named("software.amazon.awssdk.core.client.builder.SdkClientBuilder")));
|
||||
.and(
|
||||
implementsInterface(
|
||||
named("software.amazon.awssdk.core.client.builder.SdkClientBuilder")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,12 +2,10 @@ package datadog.trace.instrumentation.aws.v2;
|
|||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.extendsClass;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeScope;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -36,8 +34,7 @@ public final class AwsHttpClientInstrumentation extends AbstractAwsClientInstrum
|
|||
"software.amazon.awssdk.core.internal.http.pipeline.stages.MakeHttpRequestStage")
|
||||
.or(
|
||||
named(
|
||||
"software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage"))))
|
||||
.and(not(isInterface()));
|
||||
"software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage"))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.couchbase.client;
|
||||
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
|
||||
import com.couchbase.client.java.CouchbaseCluster;
|
||||
|
@ -29,10 +27,8 @@ public class CouchbaseBucketInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(
|
||||
named("com.couchbase.client.java.bucket.DefaultAsyncBucketManager")
|
||||
.or(named("com.couchbase.client.java.CouchbaseAsyncBucket")));
|
||||
return named("com.couchbase.client.java.bucket.DefaultAsyncBucketManager")
|
||||
.or(named("com.couchbase.client.java.CouchbaseAsyncBucket"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package datadog.trace.instrumentation.couchbase.client;
|
||||
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
@ -29,10 +28,8 @@ public class CouchbaseClusterInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(
|
||||
named("com.couchbase.client.java.cluster.DefaultAsyncClusterManager")
|
||||
.or(named("com.couchbase.client.java.CouchbaseAsyncCluster")));
|
||||
return named("com.couchbase.client.java.cluster.DefaultAsyncClusterManager")
|
||||
.or(named("com.couchbase.client.java.CouchbaseAsyncCluster"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package datadog.trace.instrumentation.dropwizard.view;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -34,7 +32,7 @@ public final class DropwizardViewInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("io.dropwizard.views.ViewRenderer")));
|
||||
return implementsInterface(named("io.dropwizard.views.ViewRenderer"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,10 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSp
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.elasticsearch.ElasticsearchRestClientDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
|
@ -42,7 +40,7 @@ public class Elasticsearch5RestClientInstrumentation extends Instrumenter.Defaul
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(named("org.elasticsearch.client.RestClient"));
|
||||
return named("org.elasticsearch.client.RestClient");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,10 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSp
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.elasticsearch.ElasticsearchRestClientDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
|
@ -43,7 +41,7 @@ public class Elasticsearch6RestClientInstrumentation extends Instrumenter.Defaul
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(named("org.elasticsearch.client.RestClient"));
|
||||
return named("org.elasticsearch.client.RestClient");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,10 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSp
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.elasticsearch.ElasticsearchTransportClientDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -35,7 +33,7 @@ public class Elasticsearch2TransportClientInstrumentation extends Instrumenter.D
|
|||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
// If we want to be more generic, we could instrument the interface instead:
|
||||
// .and(safeHasSuperType(named("org.elasticsearch.client.ElasticsearchClient"))))
|
||||
return not(isInterface()).and(named("org.elasticsearch.client.support.AbstractClient"));
|
||||
return named("org.elasticsearch.client.support.AbstractClient");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,10 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSp
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.elasticsearch.ElasticsearchTransportClientDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -36,7 +34,7 @@ public class Elasticsearch53TransportClientInstrumentation extends Instrumenter.
|
|||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
// If we want to be more generic, we could instrument the interface instead:
|
||||
// .and(safeHasSuperType(named("org.elasticsearch.client.ElasticsearchClient"))))
|
||||
return not(isInterface()).and(named("org.elasticsearch.client.support.AbstractClient"));
|
||||
return named("org.elasticsearch.client.support.AbstractClient");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,10 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSp
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.elasticsearch.ElasticsearchTransportClientDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -35,7 +33,7 @@ public class Elasticsearch5TransportClientInstrumentation extends Instrumenter.D
|
|||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
// If we want to be more generic, we could instrument the interface instead:
|
||||
// .and(safeHasSuperType(named("org.elasticsearch.client.ElasticsearchClient"))))
|
||||
return not(isInterface()).and(named("org.elasticsearch.client.support.AbstractClient"));
|
||||
return named("org.elasticsearch.client.support.AbstractClient");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,10 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSp
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.elasticsearch.ElasticsearchTransportClientDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -39,7 +37,7 @@ public class Elasticsearch6TransportClientInstrumentation extends Instrumenter.D
|
|||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
// If we want to be more generic, we could instrument the interface instead:
|
||||
// .and(safeHasSuperType(named("org.elasticsearch.client.ElasticsearchClient"))))
|
||||
return not(isInterface()).and(named("org.elasticsearch.client.support.AbstractClient"));
|
||||
return named("org.elasticsearch.client.support.AbstractClient");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,11 +6,9 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.finatra.FinatraDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
|
@ -53,8 +51,8 @@ public class FinatraInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
return nameStartsWith("com.twitter.finatra.")
|
||||
.and(not(isInterface()))
|
||||
.and(extendsClass(named("com.twitter.finatra.http.internal.routing.Route")));
|
||||
.<TypeDescription>and(
|
||||
extendsClass(named("com.twitter.finatra.http.internal.routing.Route")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v3_3;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -31,7 +29,7 @@ public class CriteriaInstrumentation extends AbstractHibernateInstrumentation {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.Criteria")));
|
||||
return implementsInterface(named("org.hibernate.Criteria"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v3_3;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -33,7 +31,7 @@ public class QueryInstrumentation extends AbstractHibernateInstrumentation {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.Query")));
|
||||
return implementsInterface(named("org.hibernate.Query"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v3_3;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
|
@ -40,7 +39,7 @@ public class SessionFactoryInstrumentation extends AbstractHibernateInstrumentat
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.SessionFactory")));
|
||||
return implementsInterface(named("org.hibernate.SessionFactory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v3_3;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;
|
||||
import static datadog.trace.instrumentation.hibernate.SessionMethodUtils.SCOPE_ONLY_METHODS;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
@ -48,10 +47,8 @@ public class SessionInstrumentation extends AbstractHibernateInstrumentation {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(
|
||||
hasInterface(
|
||||
named("org.hibernate.Session").or(named("org.hibernate.StatelessSession"))));
|
||||
return implementsInterface(
|
||||
named("org.hibernate.Session").or(named("org.hibernate.StatelessSession")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v3_3;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -31,7 +29,7 @@ public class TransactionInstrumentation extends AbstractHibernateInstrumentation
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.Transaction")));
|
||||
return implementsInterface(named("org.hibernate.Transaction"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v4_0;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -31,7 +29,7 @@ public class CriteriaInstrumentation extends AbstractHibernateInstrumentation {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.Criteria")));
|
||||
return implementsInterface(named("org.hibernate.Criteria"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v4_0;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -33,7 +31,7 @@ public class QueryInstrumentation extends AbstractHibernateInstrumentation {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.Query")));
|
||||
return implementsInterface(named("org.hibernate.Query"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v4_0;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
|
@ -34,7 +32,7 @@ public class SessionFactoryInstrumentation extends AbstractHibernateInstrumentat
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.SessionFactory")));
|
||||
return implementsInterface(named("org.hibernate.SessionFactory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v4_0;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.instrumentation.hibernate.HibernateDecorator.DECORATOR;
|
||||
import static datadog.trace.instrumentation.hibernate.SessionMethodUtils.SCOPE_ONLY_METHODS;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
@ -46,7 +45,7 @@ public class SessionInstrumentation extends AbstractHibernateInstrumentation {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.SharedSessionContract")));
|
||||
return implementsInterface(named("org.hibernate.SharedSessionContract"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v4_0;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -31,7 +29,7 @@ public class TransactionInstrumentation extends AbstractHibernateInstrumentation
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.Transaction")));
|
||||
return implementsInterface(named("org.hibernate.Transaction"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v4_3;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -47,7 +45,7 @@ public class ProcedureCallInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.procedure.ProcedureCall")));
|
||||
return implementsInterface(named("org.hibernate.procedure.ProcedureCall"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package datadog.trace.instrumentation.hibernate.core.v4_3;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -53,7 +52,7 @@ public class SessionInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("org.hibernate.SharedSessionContract")));
|
||||
return implementsInterface(named("org.hibernate.SharedSessionContract"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package datadog.trace.instrumentation.java.concurrent;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.any;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
import datadog.trace.api.Config;
|
||||
|
@ -102,9 +101,9 @@ public abstract class AbstractExecutorInstrumentation extends Instrumenter.Defau
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
ElementMatcher.Junction<TypeDescription> matcher = not(isInterface());
|
||||
ElementMatcher.Junction<TypeDescription> matcher = any();
|
||||
final ElementMatcher.Junction<TypeDescription> hasExecutorInterfaceMatcher =
|
||||
hasInterface(named(Executor.class.getName()));
|
||||
implementsInterface(named(Executor.class.getName()));
|
||||
if (!TRACE_ALL_EXECUTORS) {
|
||||
matcher =
|
||||
matcher.and(
|
||||
|
|
|
@ -3,7 +3,6 @@ package datadog.trace.instrumentation.java.concurrent;
|
|||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.extendsClass;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
@ -44,7 +43,7 @@ public final class AkkaForkJoinTaskInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(extendsClass(named(TASK_CLASS_NAME)));
|
||||
return extendsClass(named(TASK_CLASS_NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package datadog.trace.instrumentation.java.concurrent;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -79,22 +77,17 @@ public final class FutureInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
final ElementMatcher.Junction<TypeDescription> hasFutureInterfaceMatcher =
|
||||
hasInterface(named(Future.class.getName()));
|
||||
return not(isInterface())
|
||||
.and(
|
||||
new ElementMatcher<TypeDescription>() {
|
||||
@Override
|
||||
public boolean matches(final TypeDescription target) {
|
||||
final boolean whitelisted = WHITELISTED_FUTURES.contains(target.getName());
|
||||
if (!whitelisted
|
||||
&& log.isDebugEnabled()
|
||||
&& hasFutureInterfaceMatcher.matches(target)) {
|
||||
log.debug("Skipping future instrumentation for {}", target.getName());
|
||||
}
|
||||
return whitelisted;
|
||||
}
|
||||
})
|
||||
.and(hasFutureInterfaceMatcher); // Apply expensive matcher last.
|
||||
implementsInterface(named(Future.class.getName()));
|
||||
return new ElementMatcher.Junction.AbstractBase<TypeDescription>() {
|
||||
@Override
|
||||
public boolean matches(final TypeDescription target) {
|
||||
final boolean whitelisted = WHITELISTED_FUTURES.contains(target.getName());
|
||||
if (!whitelisted && log.isDebugEnabled() && hasFutureInterfaceMatcher.matches(target)) {
|
||||
log.debug("Skipping future instrumentation for {}", target.getName());
|
||||
}
|
||||
return whitelisted;
|
||||
}
|
||||
}.and(hasFutureInterfaceMatcher); // Apply expensive matcher last.
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,6 @@ package datadog.trace.instrumentation.java.concurrent;
|
|||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.extendsClass;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
@ -41,7 +40,7 @@ public final class JavaForkJoinTaskInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(extendsClass(named(ForkJoinTask.class.getName())));
|
||||
return extendsClass(named(ForkJoinTask.class.getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package datadog.trace.instrumentation.java.concurrent;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -34,8 +32,7 @@ public final class RunnableCallableInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(hasInterface(named(Runnable.class.getName()).or(named(Callable.class.getName()))));
|
||||
return implementsInterface(named(Runnable.class.getName()).or(named(Callable.class.getName())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,6 @@ package datadog.trace.instrumentation.java.concurrent;
|
|||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.extendsClass;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
@ -43,7 +42,7 @@ public final class ScalaForkJoinTaskInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(extendsClass(named(TASK_CLASS_NAME)));
|
||||
return extendsClass(named(TASK_CLASS_NAME));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.jaxrs1;
|
||||
|
||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
|
||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasNoResources;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasSuperMethod;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.safeHasSuperType;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
|
@ -12,7 +12,6 @@ import static net.bytebuddy.matcher.ElementMatchers.declaresMethod;
|
|||
import static net.bytebuddy.matcher.ElementMatchers.isAnnotatedWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -37,7 +36,7 @@ public final class JaxRsAnnotationsInstrumentation extends Instrumenter.Default
|
|||
// this is required to make sure instrumentation won't apply to jax-rs 2
|
||||
@Override
|
||||
public ElementMatcher<ClassLoader> classLoaderMatcher() {
|
||||
return not(classLoaderHasClasses("javax.ws.rs.container.AsyncResponse"));
|
||||
return classLoaderHasNoResources("javax/ws/rs/container/AsyncResponse.class");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package datadog.trace.instrumentation.jaxrs2;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jaxrs2.JaxRsAnnotationsDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
|
@ -30,8 +28,7 @@ public abstract class AbstractRequestContextInstrumentation extends Instrumenter
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(hasInterface(named("javax.ws.rs.container.ContainerRequestContext")));
|
||||
return implementsInterface(named("javax.ws.rs.container.ContainerRequestContext"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.jaxrs2;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
|
@ -32,8 +30,7 @@ public class ContainerRequestFilterInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(hasInterface(named("javax.ws.rs.container.ContainerRequestFilter")));
|
||||
return implementsInterface(named("javax.ws.rs.container.ContainerRequestFilter"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.jaxrs2;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.instrumentation.jaxrs2.JaxRsAnnotationsDecorator.DECORATE;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
@ -35,7 +35,7 @@ public final class JaxRsAsyncResponseInstrumentation extends Instrumenter.Defaul
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return hasInterface(named("javax.ws.rs.container.AsyncResponse"));
|
||||
return implementsInterface(named("javax.ws.rs.container.AsyncResponse"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,7 @@ package datadog.trace.instrumentation.jaxrs.v1;
|
|||
|
||||
import static datadog.trace.agent.decorator.HttpServerDecorator.DD_SPAN_ATTRIBUTE;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.extendsClass;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
|
@ -36,7 +36,7 @@ public final class JaxRsClientV1Instrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return hasInterface(named("com.sun.jersey.api.client.ClientHandler"));
|
||||
return implementsInterface(named("com.sun.jersey.api.client.ClientHandler"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package datadog.trace.instrumentation.jdbc;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
|
@ -27,7 +26,7 @@ public final class ConnectionInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("java.sql.Connection")));
|
||||
return implementsInterface(named("java.sql.Connection"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
package datadog.trace.instrumentation.jdbc;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jdbc.DataSourceDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -42,7 +40,7 @@ public final class DataSourceInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.sql.DataSource")));
|
||||
return implementsInterface(named("javax.sql.DataSource"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.jdbc;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
|
@ -30,7 +28,7 @@ public final class DriverInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("java.sql.Driver")));
|
||||
return implementsInterface(named("java.sql.Driver"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
package datadog.trace.instrumentation.jdbc;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jdbc.JDBCDecorator.DECORATE;
|
||||
import static datadog.trace.instrumentation.jdbc.JDBCUtils.connectionFromStatement;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -35,7 +33,7 @@ public final class PreparedStatementInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("java.sql.PreparedStatement")));
|
||||
return implementsInterface(named("java.sql.PreparedStatement"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
package datadog.trace.instrumentation.jdbc;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jdbc.JDBCDecorator.DECORATE;
|
||||
import static datadog.trace.instrumentation.jdbc.JDBCUtils.connectionFromStatement;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -35,7 +33,7 @@ public final class StatementInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("java.sql.Statement")));
|
||||
return implementsInterface(named("java.sql.Statement"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.jedis;
|
||||
|
||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
|
||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasNoResources;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jedis.JedisClientDecorator.DECORATE;
|
||||
|
@ -8,7 +8,6 @@ import static java.util.Collections.singletonMap;
|
|||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -34,7 +33,7 @@ public final class JedisInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<ClassLoader> classLoaderMatcher() {
|
||||
return not(classLoaderHasClasses("redis.clients.jedis.commands.ProtocolCommand"));
|
||||
return classLoaderHasNoResources("redis/clients/jedis/commands/ProtocolCommand.class");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package datadog.trace.instrumentation.jetty8;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
@ -29,9 +28,8 @@ public final class JettyHandlerInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(hasInterface(named("org.eclipse.jetty.server.Handler")))
|
||||
.and(not(named("org.eclipse.jetty.server.handler.HandlerWrapper")));
|
||||
return not(named("org.eclipse.jetty.server.handler.HandlerWrapper"))
|
||||
.and(implementsInterface(named("org.eclipse.jetty.server.Handler")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package datadog.trace.instrumentation.jms;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jms.JMSDecorator.CONSUMER_DECORATE;
|
||||
import static datadog.trace.instrumentation.jms.MessageExtractAdapter.GETTER;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -37,7 +35,7 @@ public final class JMSMessageConsumerInstrumentation extends Instrumenter.Defaul
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.jms.MessageConsumer")));
|
||||
return implementsInterface(named("javax.jms.MessageConsumer"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
package datadog.trace.instrumentation.jms;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jms.JMSDecorator.CONSUMER_DECORATE;
|
||||
import static datadog.trace.instrumentation.jms.MessageExtractAdapter.GETTER;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -35,7 +33,7 @@ public final class JMSMessageListenerInstrumentation extends Instrumenter.Defaul
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.jms.MessageListener")));
|
||||
return implementsInterface(named("javax.jms.MessageListener"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package datadog.trace.instrumentation.jms;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jms.JMSDecorator.PRODUCER_DECORATE;
|
||||
import static datadog.trace.instrumentation.jms.MessageInjectAdapter.SETTER;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -37,7 +35,7 @@ public final class JMSMessageProducerInstrumentation extends Instrumenter.Defaul
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.jms.MessageProducer")));
|
||||
return implementsInterface(named("javax.jms.MessageProducer"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
package datadog.trace.instrumentation.jsp;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jsp.JSPDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -31,7 +29,7 @@ public final class JSPInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.servlet.jsp.HttpJspPage")));
|
||||
return implementsInterface(named("javax.servlet.jsp.HttpJspPage"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package datadog.trace.instrumentation.netty40;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -35,7 +33,7 @@ public class ChannelFutureListenerInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("io.netty.channel.ChannelFutureListener")));
|
||||
return implementsInterface(named("io.netty.channel.ChannelFutureListener"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package datadog.trace.instrumentation.netty40;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeScope;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
|
@ -48,7 +46,7 @@ public class NettyChannelPipelineInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("io.netty.channel.ChannelPipeline")));
|
||||
return implementsInterface(named("io.netty.channel.ChannelPipeline"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package datadog.trace.instrumentation.netty41;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -35,7 +33,7 @@ public class ChannelFutureListenerInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("io.netty.channel.ChannelFutureListener")));
|
||||
return implementsInterface(named("io.netty.channel.ChannelFutureListener"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package datadog.trace.instrumentation.netty41;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeScope;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
|
@ -48,7 +46,7 @@ public class NettyChannelPipelineInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("io.netty.channel.ChannelPipeline")));
|
||||
return implementsInterface(named("io.netty.channel.ChannelPipeline"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.play24;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
|
@ -22,7 +22,7 @@ public final class PlayInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return hasInterface(named("play.api.mvc.Action"));
|
||||
return implementsInterface(named("play.api.mvc.Action"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.play26;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
|
@ -22,7 +22,7 @@ public final class PlayInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return hasInterface(named("play.api.mvc.Action"));
|
||||
return implementsInterface(named("play.api.mvc.Action"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.playws21;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.playws21.HeadersInjectAdapter.SETTER;
|
||||
|
@ -33,7 +33,7 @@ public class PlayWSClientInstrumentation extends Instrumenter.Default {
|
|||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
// CachingAsyncHttpClient rejects overrides to AsyncHandler
|
||||
// It also delegates to another AsyncHttpClient
|
||||
return hasInterface(named("play.shaded.ahc.org.asynchttpclient.AsyncHttpClient"))
|
||||
return implementsInterface(named("play.shaded.ahc.org.asynchttpclient.AsyncHttpClient"))
|
||||
.and(not(named("play.api.libs.ws.ahc.cache.CachingAsyncHttpClient")));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.playws2;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.playws2.HeadersInjectAdapter.SETTER;
|
||||
|
@ -33,7 +33,7 @@ public class PlayWSClientInstrumentation extends Instrumenter.Default {
|
|||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
// CachingAsyncHttpClient rejects overrides to AsyncHandler
|
||||
// It also delegates to another AsyncHttpClient
|
||||
return hasInterface(named("play.shaded.ahc.org.asynchttpclient.AsyncHttpClient"))
|
||||
return implementsInterface(named("play.shaded.ahc.org.asynchttpclient.AsyncHttpClient"))
|
||||
.and(not(named("play.api.libs.ws.ahc.cache.CachingAsyncHttpClient")));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.rabbitmq.amqp;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan;
|
||||
|
@ -13,7 +13,6 @@ import static datadog.trace.instrumentation.rabbitmq.amqp.TextMapExtractAdapter.
|
|||
import static datadog.trace.instrumentation.rabbitmq.amqp.TextMapInjectAdapter.SETTER;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.canThrow;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isGetter;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isSetter;
|
||||
|
@ -56,7 +55,7 @@ public class RabbitChannelInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("com.rabbitmq.client.Channel")));
|
||||
return implementsInterface(named("com.rabbitmq.client.Channel"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package datadog.trace.instrumentation.rabbitmq.amqp;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.instrumentation.rabbitmq.amqp.RabbitDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import com.rabbitmq.client.Command;
|
||||
|
@ -28,7 +26,7 @@ public class RabbitCommandInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("com.rabbitmq.client.Command")));
|
||||
return implementsInterface(named("com.rabbitmq.client.Command"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.ratpack;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
|
@ -27,7 +27,7 @@ public final class ContinuationInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
return nameStartsWith("ratpack.exec.")
|
||||
.<TypeDescription>and(hasInterface(named("ratpack.exec.internal.Continuation")));
|
||||
.<TypeDescription>and(implementsInterface(named("ratpack.exec.internal.Continuation")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.ratpack;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
|
@ -25,7 +25,7 @@ public class ServerErrorHandlerInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface().or(isAbstract()))
|
||||
.and(hasInterface(named("ratpack.error.ServerErrorHandler")));
|
||||
.and(implementsInterface(named("ratpack.error.ServerErrorHandler")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,10 +6,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.rmi.client.RmiClientDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -33,7 +31,7 @@ public final class RmiClientInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(extendsClass(named("sun.rmi.server.UnicastRef")));
|
||||
return extendsClass(named("sun.rmi.server.UnicastRef"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,9 +5,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
|
|||
import static datadog.trace.instrumentation.rmi.context.ContextPropagator.PROPAGATOR;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -53,7 +51,7 @@ public class RmiClientContextInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(extendsClass(named("sun.rmi.transport.StreamRemoteCall")));
|
||||
return extendsClass(named("sun.rmi.transport.StreamRemoteCall"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,11 +3,9 @@ package datadog.trace.instrumentation.rmi.context.server;
|
|||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.extendsClass;
|
||||
import static datadog.trace.instrumentation.rmi.context.ContextPropagator.DD_CONTEXT_CALL_ID;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isStatic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -28,7 +26,7 @@ public class RmiServerContextInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(extendsClass(named("sun.rmi.transport.ObjectTable")));
|
||||
return extendsClass(named("sun.rmi.transport.ObjectTable"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
|||
import static datadog.trace.bootstrap.instrumentation.rmi.ThreadLocalContext.THREAD_LOCAL_CONTEXT;
|
||||
import static datadog.trace.instrumentation.rmi.server.RmiServerDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isStatic;
|
||||
|
@ -43,7 +42,7 @@ public final class RmiServerInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(extendsClass(named("java.rmi.server.RemoteServer")));
|
||||
return extendsClass(named("java.rmi.server.RemoteServer"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package datadog.trace.instrumentation.servlet2;
|
||||
|
||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
|
||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasNoResources;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.safeHasSuperType;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -26,7 +24,8 @@ public final class Servlet2Instrumentation extends Instrumenter.Default {
|
|||
// this is required to make sure servlet 2 instrumentation won't apply to servlet 3
|
||||
@Override
|
||||
public ElementMatcher<ClassLoader> classLoaderMatcher() {
|
||||
return not(classLoaderHasClasses("javax.servlet.AsyncEvent", "javax.servlet.AsyncListener"));
|
||||
return classLoaderHasNoResources(
|
||||
"javax/servlet/AsyncEvent.class", "javax/servlet/AsyncListener.class");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,10 +42,8 @@ public final class Servlet2Instrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(
|
||||
safeHasSuperType(
|
||||
named("javax.servlet.FilterChain").or(named("javax.servlet.http.HttpServlet"))));
|
||||
return safeHasSuperType(
|
||||
named("javax.servlet.FilterChain").or(named("javax.servlet.http.HttpServlet")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package datadog.trace.instrumentation.servlet3;
|
||||
|
||||
import static datadog.trace.agent.decorator.HttpServerDecorator.DD_SPAN_ATTRIBUTE;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
import static datadog.trace.instrumentation.servlet3.HttpServletRequestInjectAdapter.SETTER;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -38,7 +36,7 @@ public final class AsyncContextInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.servlet.AsyncContext")));
|
||||
return implementsInterface(named("javax.servlet.AsyncContext"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,10 +2,8 @@ package datadog.trace.instrumentation.servlet3;
|
|||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.safeHasSuperType;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -35,10 +33,8 @@ public final class Servlet3Instrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(
|
||||
safeHasSuperType(
|
||||
named("javax.servlet.FilterChain").or(named("javax.servlet.http.HttpServlet"))));
|
||||
return safeHasSuperType(
|
||||
named("javax.servlet.FilterChain").or(named("javax.servlet.http.HttpServlet")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package datadog.trace.instrumentation.servlet.dispatcher;
|
||||
|
||||
import static datadog.trace.agent.decorator.HttpServerDecorator.DD_SPAN_ATTRIBUTE;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
|
@ -9,10 +9,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
|||
import static datadog.trace.instrumentation.servlet.ServletRequestSetter.SETTER;
|
||||
import static datadog.trace.instrumentation.servlet.dispatcher.RequestDispatcherDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -46,7 +44,7 @@ public final class RequestDispatcherInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.servlet.RequestDispatcher")));
|
||||
return implementsInterface(named("javax.servlet.RequestDispatcher"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package datadog.trace.instrumentation.servlet.dispatcher;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
|
@ -27,7 +25,7 @@ public final class ServletContextInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.servlet.ServletContext")));
|
||||
return implementsInterface(named("javax.servlet.ServletContext"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package datadog.trace.instrumentation.servlet.filter;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.servlet.filter.FilterDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -44,7 +42,7 @@ public final class FilterInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.servlet.Filter")));
|
||||
return implementsInterface(named("javax.servlet.Filter"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,12 +6,10 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.servlet.http.HttpServletDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isProtected;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -46,7 +44,7 @@ public final class HttpServletInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(extendsClass(named("javax.servlet.http.HttpServlet")));
|
||||
return extendsClass(named("javax.servlet.http.HttpServlet"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.servlet.http;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.propagate;
|
||||
|
@ -8,9 +8,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
|||
import static datadog.trace.instrumentation.servlet.ServletRequestSetter.SETTER;
|
||||
import static datadog.trace.instrumentation.servlet.http.HttpServletResponseDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -43,7 +41,7 @@ public final class HttpServletResponseInstrumentation extends Instrumenter.Defau
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(hasInterface(named("javax.servlet.http.HttpServletResponse")));
|
||||
return implementsInterface(named("javax.servlet.http.HttpServletResponse"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,9 +6,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSp
|
|||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.springdata.SpringDataDecorator.DECORATOR;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -38,8 +36,7 @@ public final class SpringRepositoryInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(named("org.springframework.data.repository.core.support.RepositoryFactorySupport"));
|
||||
return named("org.springframework.data.repository.core.support.RepositoryFactorySupport");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,9 +5,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
|||
import static datadog.trace.instrumentation.springscheduling.SpringSchedulingDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -29,7 +27,7 @@ public final class SpringSchedulingInstrumentation extends Instrumenter.Default
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface()).and(named("org.springframework.scheduling.config.Task"));
|
||||
return named("org.springframework.scheduling.config.Task");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package datadog.trace.instrumentation.springwebflux.client;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
|
@ -37,7 +37,8 @@ public class DefaultWebClientInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<? super TypeDescription> typeMatcher() {
|
||||
return hasInterface(named("org.springframework.web.reactive.function.client.ExchangeFunction"));
|
||||
return implementsInterface(
|
||||
named("org.springframework.web.reactive.function.client.ExchangeFunction"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package datadog.trace.instrumentation.springwebflux.server;
|
||||
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
@ -23,9 +22,8 @@ public final class HandlerAdapterInstrumentation extends AbstractWebfluxInstrume
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(not(isAbstract()))
|
||||
.and(hasInterface(named("org.springframework.web.reactive.HandlerAdapter")));
|
||||
return not(isAbstract())
|
||||
.and(implementsInterface(named("org.springframework.web.reactive.HandlerAdapter")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
package datadog.trace.instrumentation.springweb;
|
||||
|
||||
import static datadog.trace.agent.decorator.HttpServerDecorator.DD_SPAN_ATTRIBUTE;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.hasInterface;
|
||||
import static datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers.implementsInterface;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan;
|
||||
import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.springweb.SpringWebHttpServerDecorator.DECORATE;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
|
||||
|
@ -36,8 +34,7 @@ public final class HandlerAdapterInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return not(isInterface())
|
||||
.and(hasInterface(named("org.springframework.web.servlet.HandlerAdapter")));
|
||||
return implementsInterface(named("org.springframework.web.servlet.HandlerAdapter"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package datadog.smoketest.springboot;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
|
@ -8,5 +9,6 @@ public class SpringbootApplication {
|
|||
|
||||
public static void main(final String[] args) {
|
||||
SpringApplication.run(SpringbootApplication.class, args);
|
||||
System.out.println("Started in " + ManagementFactory.getRuntimeMXBean().getUptime() + "ms");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue