Merge pull request #26 from open-telemetry/otel-dd-merged
Merge changes from dd-trace-java 0.38.0
This commit is contained in:
commit
1f67af03ef
|
@ -107,10 +107,10 @@ jobs:
|
|||
environment:
|
||||
- TEST_TASK: testJavaIBM8
|
||||
|
||||
# test_zulu8:
|
||||
# <<: *default_test_job
|
||||
# environment:
|
||||
# - TEST_TASK: testJavaZULU8
|
||||
test_zulu8:
|
||||
<<: *default_test_job
|
||||
environment:
|
||||
- TEST_TASK: testJavaZULU8
|
||||
|
||||
test_9:
|
||||
<<: *default_test_job
|
||||
|
@ -283,12 +283,12 @@ workflows:
|
|||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
# - test_zulu8:
|
||||
# requires:
|
||||
# - build
|
||||
# filters:
|
||||
# tags:
|
||||
# only: /.*/
|
||||
- test_zulu8:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test_9:
|
||||
requires:
|
||||
- build
|
||||
|
@ -353,7 +353,7 @@ workflows:
|
|||
- test_8
|
||||
- test_latest8
|
||||
- test_ibm8
|
||||
# - test_zulu8
|
||||
- test_zulu8
|
||||
- test_9
|
||||
- test_10
|
||||
- test_11
|
||||
|
@ -374,7 +374,7 @@ workflows:
|
|||
- test_8
|
||||
- test_latest8
|
||||
- test_ibm8
|
||||
# - test_zulu8
|
||||
- test_zulu8
|
||||
- test_9
|
||||
- test_10
|
||||
- test_11
|
||||
|
|
|
@ -9,3 +9,4 @@ logback.xml,net.logstash.logback,Apache-2.0,
|
|||
import (test),org.junit,EPL-1.0,Copyright © 2002-2017 JUnit. All Rights Reserved.
|
||||
import (test),org.assertj,Apache-2.0,Copyright 2012-2017 the original author or authors.
|
||||
import (test),org.mockito,MIT,Copyright (c) 2007 Mockito contributors
|
||||
import (test),info.picocli,Apache-2.0,
|
||||
|
|
|
|
@ -12,7 +12,3 @@ dependencies {
|
|||
compile group: 'org.slf4j', name: 'slf4j-simple', version: versions.slf4j
|
||||
// ^ Generally a bad idea for libraries, but we're shadowing.
|
||||
}
|
||||
|
||||
jar {
|
||||
classifier = 'unbundled'
|
||||
}
|
||||
|
|
|
@ -0,0 +1,313 @@
|
|||
package datadog.trace.bootstrap;
|
||||
|
||||
import java.lang.instrument.Instrumentation;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Agent start up logic.
|
||||
*
|
||||
* <p>This class is loaded and called by {@code datadog.trace.agent.AgentBootstrap}
|
||||
*
|
||||
* <p>The intention is for this class to be loaded by bootstrap classloader to make sure we have
|
||||
* unimpeded access to the rest of Datadog's agent parts.
|
||||
*/
|
||||
public class Agent {
|
||||
|
||||
private static final String SIMPLE_LOGGER_SHOW_DATE_TIME_PROPERTY =
|
||||
"datadog.slf4j.simpleLogger.showDateTime";
|
||||
private static final String SIMPLE_LOGGER_DATE_TIME_FORMAT_PROPERTY =
|
||||
"datadog.slf4j.simpleLogger.dateTimeFormat";
|
||||
private static final String SIMPLE_LOGGER_DATE_TIME_FORMAT_DEFAULT =
|
||||
"'[dd.trace 'yyyy-MM-dd HH:mm:ss:SSS Z']'";
|
||||
private static final String SIMPLE_LOGGER_DEFAULT_LOG_LEVEL_PROPERTY =
|
||||
"datadog.slf4j.simpleLogger.defaultLogLevel";
|
||||
|
||||
// We cannot use lombok here because we need to configure logger first
|
||||
private static final Logger LOGGER;
|
||||
|
||||
static {
|
||||
// We can configure logger here because datadog.trace.agent.AgentBootstrap doesn't touch it.
|
||||
configureLogger();
|
||||
LOGGER = LoggerFactory.getLogger(Agent.class);
|
||||
}
|
||||
|
||||
// fields must be managed under class lock
|
||||
private static ClassLoader AGENT_CLASSLOADER = null;
|
||||
|
||||
public static void start(final Instrumentation inst, final URL bootstrapURL) throws Exception {
|
||||
startDatadogAgent(inst, bootstrapURL);
|
||||
|
||||
final boolean appUsingCustomLogManager = isAppUsingCustomLogManager();
|
||||
|
||||
/*
|
||||
* java.util.logging.LogManager maintains a final static LogManager, which is created during class initialization.
|
||||
*
|
||||
* JMXFetch uses jre bootstrap classes which touch this class. This means applications which require a custom log
|
||||
* manager may not have a chance to set the global log manager if jmxfetch runs first. JMXFetch will incorrectly
|
||||
* set the global log manager in cases where the app sets the log manager system property or when the log manager
|
||||
* class is not on the system classpath.
|
||||
*
|
||||
* Our solution is to delay the initialization of jmxfetch when we detect a custom log manager being used.
|
||||
*
|
||||
* Once we see the LogManager class loading, it's safe to start jmxfetch because the application is already setting
|
||||
* the global log manager and jmxfetch won't be able to touch it due to classloader locking.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Similar thing happens with DatadogTracer on (at least) zulu-8 because it uses OkHttp which indirectly loads JFR
|
||||
* events which in turn loads LogManager. This is not a problem on newer JDKs because there JFR uses different
|
||||
* logging facility.
|
||||
*/
|
||||
if (isJavaBefore9WithJFR() && appUsingCustomLogManager) {
|
||||
LOGGER.debug("Custom logger detected. Delaying Datadog Tracer initialization.");
|
||||
registerLogManagerCallback(new InstallDatadogTracerCallback(inst, bootstrapURL));
|
||||
} else {
|
||||
installDatadogTracer(inst, bootstrapURL);
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerLogManagerCallback(final Runnable callback) throws Exception {
|
||||
final Class<?> agentInstallerClass =
|
||||
AGENT_CLASSLOADER.loadClass("datadog.trace.agent.tooling.AgentInstaller");
|
||||
final Method registerCallbackMethod =
|
||||
agentInstallerClass.getMethod("registerClassLoadCallback", String.class, Runnable.class);
|
||||
registerCallbackMethod.invoke(null, "java.util.logging.LogManager", callback);
|
||||
}
|
||||
|
||||
protected abstract static class ClassLoadCallBack implements Runnable {
|
||||
|
||||
final Instrumentation inst;
|
||||
final URL bootstrapURL;
|
||||
|
||||
ClassLoadCallBack(final Instrumentation inst, final URL bootstrapURL) {
|
||||
this.inst = inst;
|
||||
this.bootstrapURL = bootstrapURL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
/*
|
||||
* This callback is called from within bytecode transformer. This can be a problem if callback tries
|
||||
* to load classes being transformed. To avoid this we start a thread here that calls the callback.
|
||||
* This seems to resolve this problem.
|
||||
*/
|
||||
final Thread thread =
|
||||
new Thread(
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
execute();
|
||||
} catch (final Exception e) {
|
||||
LOGGER.error("Failed to run class loader callback {}", getName(), e);
|
||||
}
|
||||
}
|
||||
});
|
||||
thread.setName("dd-agent-startup-" + getName());
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
public abstract String getName();
|
||||
|
||||
public abstract void execute() throws Exception;
|
||||
}
|
||||
|
||||
protected static class InstallDatadogTracerCallback extends ClassLoadCallBack {
|
||||
InstallDatadogTracerCallback(final Instrumentation inst, final URL bootstrapURL) {
|
||||
super(inst, bootstrapURL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "datadog-tracer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
installDatadogTracer(inst, bootstrapURL);
|
||||
}
|
||||
}
|
||||
|
||||
private static synchronized void startDatadogAgent(
|
||||
final Instrumentation inst, final URL bootstrapURL) throws Exception {
|
||||
if (AGENT_CLASSLOADER == null) {
|
||||
final ClassLoader agentClassLoader =
|
||||
createDatadogClassLoader("agent-tooling-and-instrumentation.isolated", bootstrapURL);
|
||||
final ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
|
||||
try {
|
||||
Thread.currentThread().setContextClassLoader(agentClassLoader);
|
||||
final Class<?> agentInstallerClass =
|
||||
agentClassLoader.loadClass("datadog.trace.agent.tooling.AgentInstaller");
|
||||
final Method agentInstallerMethod =
|
||||
agentInstallerClass.getMethod("installBytebuddyAgent", Instrumentation.class);
|
||||
agentInstallerMethod.invoke(null, inst);
|
||||
AGENT_CLASSLOADER = agentClassLoader;
|
||||
} finally {
|
||||
Thread.currentThread().setContextClassLoader(contextLoader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static synchronized void installDatadogTracer(
|
||||
final Instrumentation inst, final URL bootstrapURL) throws Exception {
|
||||
if (AGENT_CLASSLOADER == null) {
|
||||
throw new IllegalStateException("Datadog agent should have been started already");
|
||||
}
|
||||
final ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
|
||||
// TracerInstaller.installGlobalTracer can be called multiple times without any problem
|
||||
// so there is no need to have a 'datadogTracerInstalled' flag here.
|
||||
try {
|
||||
Thread.currentThread().setContextClassLoader(AGENT_CLASSLOADER);
|
||||
// install global tracer
|
||||
final Class<?> tracerInstallerClass =
|
||||
AGENT_CLASSLOADER.loadClass("datadog.trace.agent.tooling.TracerInstaller");
|
||||
final Method tracerInstallerMethod = tracerInstallerClass.getMethod("installGlobalTracer");
|
||||
tracerInstallerMethod.invoke(null);
|
||||
final Method logVersionInfoMethod = tracerInstallerClass.getMethod("logVersionInfo");
|
||||
logVersionInfoMethod.invoke(null);
|
||||
} finally {
|
||||
Thread.currentThread().setContextClassLoader(contextLoader);
|
||||
}
|
||||
}
|
||||
|
||||
private static void configureLogger() {
|
||||
setSystemPropertyDefault(SIMPLE_LOGGER_SHOW_DATE_TIME_PROPERTY, "true");
|
||||
setSystemPropertyDefault(
|
||||
SIMPLE_LOGGER_DATE_TIME_FORMAT_PROPERTY, SIMPLE_LOGGER_DATE_TIME_FORMAT_DEFAULT);
|
||||
|
||||
if (isDebugMode()) {
|
||||
setSystemPropertyDefault(SIMPLE_LOGGER_DEFAULT_LOG_LEVEL_PROPERTY, "DEBUG");
|
||||
}
|
||||
}
|
||||
|
||||
private static void setSystemPropertyDefault(final String property, final String value) {
|
||||
if (System.getProperty(property) == null) {
|
||||
System.setProperty(property, value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the datadog classloader. This must be called after the bootstrap jar has been appened to
|
||||
* the bootstrap classpath.
|
||||
*
|
||||
* @param innerJarFilename Filename of internal jar to use for the classpath of the datadog
|
||||
* classloader
|
||||
* @param bootstrapURL
|
||||
* @return Datadog Classloader
|
||||
*/
|
||||
private static ClassLoader createDatadogClassLoader(
|
||||
final String innerJarFilename, final URL bootstrapURL) throws Exception {
|
||||
final ClassLoader agentParent;
|
||||
if (isJavaBefore9()) {
|
||||
agentParent = null; // bootstrap
|
||||
} else {
|
||||
// platform classloader is parent of system in java 9+
|
||||
agentParent = getPlatformClassLoader();
|
||||
}
|
||||
|
||||
final Class<?> loaderClass =
|
||||
ClassLoader.getSystemClassLoader().loadClass("datadog.trace.bootstrap.DatadogClassLoader");
|
||||
final Constructor constructor =
|
||||
loaderClass.getDeclaredConstructor(URL.class, String.class, ClassLoader.class);
|
||||
return (ClassLoader) constructor.newInstance(bootstrapURL, innerJarFilename, agentParent);
|
||||
}
|
||||
|
||||
private static ClassLoader getPlatformClassLoader()
|
||||
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
|
||||
/*
|
||||
Must invoke ClassLoader.getPlatformClassLoader by reflection to remain
|
||||
compatible with java 7 + 8.
|
||||
*/
|
||||
final Method method = ClassLoader.class.getDeclaredMethod("getPlatformClassLoader");
|
||||
return (ClassLoader) method.invoke(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we should log in debug level according to dd.trace.debug
|
||||
*
|
||||
* @return true if we should
|
||||
*/
|
||||
private static boolean isDebugMode() {
|
||||
final String tracerDebugLevelSysprop = "dd.trace.debug";
|
||||
final String tracerDebugLevelProp = System.getProperty(tracerDebugLevelSysprop);
|
||||
|
||||
if (tracerDebugLevelProp != null) {
|
||||
return Boolean.parseBoolean(tracerDebugLevelProp);
|
||||
}
|
||||
|
||||
final String tracerDebugLevelEnv =
|
||||
System.getenv(tracerDebugLevelSysprop.replace('.', '_').toUpperCase());
|
||||
|
||||
if (tracerDebugLevelEnv != null) {
|
||||
return Boolean.parseBoolean(tracerDebugLevelEnv);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for java or datadog-tracer sysprops which indicate that a custom log manager will be
|
||||
* used. Also search for any app classes known to set a custom log manager.
|
||||
*
|
||||
* @return true if we detect a custom log manager being used.
|
||||
*/
|
||||
private static boolean isAppUsingCustomLogManager() {
|
||||
final String tracerCustomLogManSysprop = "dd.app.customlogmanager";
|
||||
final String customLogManagerProp = System.getProperty(tracerCustomLogManSysprop);
|
||||
final String customLogManagerEnv =
|
||||
System.getenv(tracerCustomLogManSysprop.replace('.', '_').toUpperCase());
|
||||
|
||||
if (customLogManagerProp != null || customLogManagerEnv != null) {
|
||||
LOGGER.debug("Prop - customlogmanager: " + customLogManagerProp);
|
||||
LOGGER.debug("Env - customlogmanager: " + customLogManagerEnv);
|
||||
// Allow setting to skip these automatic checks:
|
||||
return Boolean.parseBoolean(customLogManagerProp)
|
||||
|| Boolean.parseBoolean(customLogManagerEnv);
|
||||
}
|
||||
|
||||
final String jbossHome = System.getenv("JBOSS_HOME");
|
||||
if (jbossHome != null) {
|
||||
LOGGER.debug("Env - jboss: " + jbossHome);
|
||||
// JBoss/Wildfly is known to set a custom log manager after startup.
|
||||
// Originally we were checking for the presence of a jboss class,
|
||||
// but it seems some non-jboss applications have jboss classes on the classpath.
|
||||
// This would cause jmxfetch initialization to be delayed indefinitely.
|
||||
// Checking for an environment variable required by jboss instead.
|
||||
return true;
|
||||
}
|
||||
|
||||
final String logManagerProp = System.getProperty("java.util.logging.manager");
|
||||
if (logManagerProp != null) {
|
||||
final boolean onSysClasspath =
|
||||
ClassLoader.getSystemResource(logManagerProp.replaceAll("\\.", "/") + ".class") != null;
|
||||
LOGGER.debug("Prop - logging.manager: " + logManagerProp);
|
||||
LOGGER.debug("logging.manager on system classpath: " + onSysClasspath);
|
||||
// Some applications set java.util.logging.manager but never actually initialize the logger.
|
||||
// Check to see if the configured manager is on the system classpath.
|
||||
// If so, it should be safe to initialize jmxfetch which will setup the log manager.
|
||||
return !onSysClasspath;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean isJavaBefore9() {
|
||||
return System.getProperty("java.version").startsWith("1.");
|
||||
}
|
||||
|
||||
private static boolean isJavaBefore9WithJFR() {
|
||||
if (!isJavaBefore9()) {
|
||||
return false;
|
||||
}
|
||||
// FIXME: this is quite a hack because there maybe jfr classes on classpath somehow that have
|
||||
// nothing to do with JDK but this should be safe because only thing this does is to delay
|
||||
// tracer install
|
||||
final String jfrClassResourceName = "jdk.jfr.Recording".replace('.', '/') + ".class";
|
||||
return Thread.currentThread().getContextClassLoader().getResource(jfrClassResourceName) != null;
|
||||
}
|
||||
}
|
|
@ -12,11 +12,12 @@ import static net.bytebuddy.matcher.ElementMatchers.not;
|
|||
|
||||
import datadog.trace.api.Config;
|
||||
import java.lang.instrument.Instrumentation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.agent.builder.AgentBuilder;
|
||||
import net.bytebuddy.agent.builder.ResettableClassFileTransformer;
|
||||
|
@ -28,7 +29,7 @@ import net.bytebuddy.utility.JavaModule;
|
|||
|
||||
@Slf4j
|
||||
public class AgentInstaller {
|
||||
private static final Map<String, Runnable> classLoadCallbacks = new ConcurrentHashMap<>();
|
||||
private static final Map<String, List<Runnable>> CLASS_LOAD_CALLBACKS = new HashMap<>();
|
||||
private static volatile Instrumentation INSTRUMENTATION;
|
||||
|
||||
public static Instrumentation getInstrumentation() {
|
||||
|
@ -254,15 +255,25 @@ public class AgentInstaller {
|
|||
/**
|
||||
* Register a callback to run when a class is loading.
|
||||
*
|
||||
* <p>Caveats: 1: This callback will be invoked by a jvm class transformer. 2: Classes filtered
|
||||
* out by {@link AgentInstaller}'s skip list will not be matched.
|
||||
* <p>Caveats:
|
||||
*
|
||||
* <ul>
|
||||
* <li>This callback will be invoked by a jvm class transformer.
|
||||
* <li>Classes filtered out by {@link AgentInstaller}'s skip list will not be matched.
|
||||
* </ul>
|
||||
*
|
||||
* @param className name of the class to match against
|
||||
* @param classLoadCallback runnable to invoke when class name matches
|
||||
* @param callback runnable to invoke when class name matches
|
||||
*/
|
||||
public static void registerClassLoadCallback(
|
||||
final String className, final Runnable classLoadCallback) {
|
||||
classLoadCallbacks.put(className, classLoadCallback);
|
||||
public static void registerClassLoadCallback(final String className, final Runnable callback) {
|
||||
synchronized (CLASS_LOAD_CALLBACKS) {
|
||||
List<Runnable> callbacks = CLASS_LOAD_CALLBACKS.get(className);
|
||||
if (callbacks == null) {
|
||||
callbacks = new ArrayList<>();
|
||||
CLASS_LOAD_CALLBACKS.put(className, callbacks);
|
||||
}
|
||||
callbacks.add(callback);
|
||||
}
|
||||
}
|
||||
|
||||
private static class ClassLoadListener implements AgentBuilder.Listener {
|
||||
|
@ -302,9 +313,12 @@ public class AgentInstaller {
|
|||
final ClassLoader classLoader,
|
||||
final JavaModule javaModule,
|
||||
final boolean b) {
|
||||
for (final Map.Entry<String, Runnable> entry : classLoadCallbacks.entrySet()) {
|
||||
if (entry.getKey().equals(typeName)) {
|
||||
entry.getValue().run();
|
||||
synchronized (CLASS_LOAD_CALLBACKS) {
|
||||
final List<Runnable> callbacks = CLASS_LOAD_CALLBACKS.get(typeName);
|
||||
if (callbacks != null) {
|
||||
for (final Runnable callback : callbacks) {
|
||||
callback.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ public final class Constants {
|
|||
*/
|
||||
public static final String[] BOOTSTRAP_PACKAGE_PREFIXES = {
|
||||
"datadog.slf4j",
|
||||
"datadog.trace.agent.TracingAgent",
|
||||
"datadog.trace.api",
|
||||
"datadog.trace.bootstrap",
|
||||
"datadog.trace.context",
|
||||
|
|
|
@ -126,7 +126,7 @@ public interface Instrumenter {
|
|||
if (log.isDebugEnabled()) {
|
||||
log.debug(
|
||||
"Instrumentation muzzled: {} -- {} on {}",
|
||||
instrumentationPrimaryName,
|
||||
instrumentationNames,
|
||||
Instrumenter.Default.this.getClass().getName(),
|
||||
classLoader);
|
||||
for (final Reference.Mismatch mismatch : mismatches) {
|
||||
|
|
|
@ -73,8 +73,8 @@ public class FieldBackedProvider implements InstrumentationContextProvider {
|
|||
|
||||
/**
|
||||
* Note: the value here has to be inside on of the prefixes in
|
||||
* datadog.trace.agent.tooling.Utils#BOOTSTRAP_PACKAGE_PREFIXES. This ensures that 'isolating' (or
|
||||
* 'module') classloaders like jboss and osgi see injected classes. This works because we
|
||||
* datadog.trace.agent.tooling.Constants#BOOTSTRAP_PACKAGE_PREFIXES. This ensures that 'isolating'
|
||||
* (or 'module') classloaders like jboss and osgi see injected classes. This works because we
|
||||
* instrument those classloaders to load everything inside bootstrap packages.
|
||||
*/
|
||||
private static final String DYNAMIC_CLASSES_PACKAGE =
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id "me.champeau.gradle.jmh" version "0.4.8"
|
||||
id "me.champeau.gradle.jmh" version "0.5.0"
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/gradle/java.gradle"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id "com.github.johnrengelman.shadow" version "4.0.4"
|
||||
id "com.github.johnrengelman.shadow" version "5.2.0"
|
||||
}
|
||||
|
||||
description = 'dd-java-agent'
|
||||
|
@ -20,7 +20,7 @@ def includeShadowJar(subproject, jarname) {
|
|||
def agent_project = project
|
||||
subproject.afterEvaluate {
|
||||
agent_project.processResources {
|
||||
from(zipTree(subproject.tasks.shadowJar.archivePath)) {
|
||||
from(zipTree(subproject.tasks.shadowJar.archiveFile)) {
|
||||
into jarname
|
||||
rename '(^.*)\\.class$', '$1.classdata'
|
||||
// Rename LICENSE file since it clashes with license dir on non-case sensitive FSs (i.e. Mac)
|
||||
|
@ -30,8 +30,6 @@ def includeShadowJar(subproject, jarname) {
|
|||
|
||||
agent_project.processResources.dependsOn subproject.tasks.shadowJar
|
||||
subproject.shadowJar {
|
||||
classifier null
|
||||
|
||||
mergeServiceFiles()
|
||||
|
||||
exclude '**/module-info.class'
|
||||
|
@ -57,13 +55,13 @@ def includeShadowJar(subproject, jarname) {
|
|||
includeShadowJar(project(':dd-java-agent:instrumentation'), 'agent-tooling-and-instrumentation.isolated')
|
||||
|
||||
jar {
|
||||
classifier = 'unbundled'
|
||||
archiveClassifier = 'unbundled'
|
||||
|
||||
manifest {
|
||||
attributes(
|
||||
"Main-Class": "datadog.trace.agent.TracingAgent",
|
||||
"Agent-Class": "datadog.trace.agent.TracingAgent",
|
||||
"Premain-Class": "datadog.trace.agent.TracingAgent",
|
||||
"Main-Class": "datadog.trace.bootstrap.AgentBootstrap",
|
||||
"Agent-Class": "datadog.trace.bootstrap.AgentBootstrap",
|
||||
"Premain-Class": "datadog.trace.bootstrap.AgentBootstrap",
|
||||
"Can-Redefine-Classes": true,
|
||||
"Can-Retransform-Classes": true,
|
||||
)
|
||||
|
@ -73,7 +71,7 @@ jar {
|
|||
shadowJar {
|
||||
configurations = [project.configurations.shadowInclude]
|
||||
|
||||
classifier null
|
||||
archiveClassifier = ''
|
||||
|
||||
mergeServiceFiles()
|
||||
|
||||
|
@ -101,6 +99,7 @@ modifyPom {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
testCompile project(':dd-java-agent:agent-bootstrap')
|
||||
testCompile project(':dd-trace-api')
|
||||
testCompile project(':dd-trace-ot')
|
||||
testCompile project(':utils:gc-utils')
|
||||
|
@ -109,7 +108,7 @@ dependencies {
|
|||
testCompile deps.testLogging
|
||||
testCompile deps.guava
|
||||
|
||||
shadowInclude project(':dd-java-agent:agent-bootstrap')
|
||||
shadowInclude project(path: ':dd-java-agent:agent-bootstrap')
|
||||
}
|
||||
|
||||
tasks.withType(Test).configureEach {
|
||||
|
|
|
@ -58,12 +58,12 @@ public final class AkkaHttpClientInstrumentation extends Instrumenter.Default {
|
|||
// This is mainly for compatibility with 10.0
|
||||
transformers.put(
|
||||
named("singleRequest").and(takesArgument(0, named("akka.http.scaladsl.model.HttpRequest"))),
|
||||
SingleRequestAdvice.class.getName());
|
||||
AkkaHttpClientInstrumentation.class.getName() + "$SingleRequestAdvice");
|
||||
// This is for 10.1+
|
||||
transformers.put(
|
||||
named("singleRequestImpl")
|
||||
.and(takesArgument(0, named("akka.http.scaladsl.model.HttpRequest"))),
|
||||
SingleRequestAdvice.class.getName());
|
||||
AkkaHttpClientInstrumentation.class.getName() + "$SingleRequestAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,10 +69,10 @@ public final class AkkaHttpServerInstrumentation extends Instrumenter.Default {
|
|||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("bindAndHandleSync").and(takesArgument(0, named("scala.Function1"))),
|
||||
AkkaHttpSyncAdvice.class.getName());
|
||||
AkkaHttpServerInstrumentation.class.getName() + "$AkkaHttpSyncAdvice");
|
||||
transformers.put(
|
||||
named("bindAndHandleAsync").and(takesArgument(0, named("scala.Function1"))),
|
||||
AkkaHttpAsyncAdvice.class.getName());
|
||||
AkkaHttpServerInstrumentation.class.getName() + "$AkkaHttpAsyncAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ object AkkaHttpTestSyncWebServer {
|
|||
val syncHandler: HttpRequest => HttpResponse = {
|
||||
case HttpRequest(GET, uri: Uri, _, _, _) => {
|
||||
val endpoint = HttpServerTest.ServerEndpoint.forPath(uri.path.toString())
|
||||
HttpServerTest.controller(endpoint, new Closure[HttpResponse]() {
|
||||
HttpServerTest.controller(endpoint, new Closure[HttpResponse](()) {
|
||||
def doCall(): HttpResponse = {
|
||||
val resp = HttpResponse(status = endpoint.getStatus)
|
||||
endpoint match {
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ApacheHttpAsyncClientInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(1, named("org.apache.http.nio.protocol.HttpAsyncResponseConsumer")))
|
||||
.and(takesArgument(2, named("org.apache.http.protocol.HttpContext")))
|
||||
.and(takesArgument(3, named("org.apache.http.concurrent.FutureCallback"))),
|
||||
ClientAdvice.class.getName());
|
||||
ApacheHttpAsyncClientInstrumentation.class.getName() + "$ClientAdvice");
|
||||
}
|
||||
|
||||
public static class ClientAdvice {
|
||||
|
|
|
@ -40,7 +40,7 @@ public class ApacheHttpClientRedirectInstrumentation extends Instrumenter.Defaul
|
|||
isMethod()
|
||||
.and(named("getRedirect"))
|
||||
.and(takesArgument(0, named("org.apache.http.HttpRequest"))),
|
||||
ClientRedirectAdvice.class.getName());
|
||||
ApacheHttpClientRedirectInstrumentation.class.getName() + "$ClientRedirectAdvice");
|
||||
}
|
||||
|
||||
public static class ClientRedirectAdvice {
|
||||
|
|
|
@ -75,7 +75,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(not(isAbstract()))
|
||||
.and(takesArguments(1))
|
||||
.and(takesArgument(0, named("org.apache.http.client.methods.HttpUriRequest"))),
|
||||
UriRequestAdvice.class.getName());
|
||||
ApacheHttpClientInstrumentation.class.getName() + "$UriRequestAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod()
|
||||
|
@ -84,7 +84,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArguments(2))
|
||||
.and(takesArgument(0, named("org.apache.http.client.methods.HttpUriRequest")))
|
||||
.and(takesArgument(1, named("org.apache.http.protocol.HttpContext"))),
|
||||
UriRequestAdvice.class.getName());
|
||||
ApacheHttpClientInstrumentation.class.getName() + "$UriRequestAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod()
|
||||
|
@ -93,7 +93,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArguments(2))
|
||||
.and(takesArgument(0, named("org.apache.http.client.methods.HttpUriRequest")))
|
||||
.and(takesArgument(1, named("org.apache.http.client.ResponseHandler"))),
|
||||
UriRequestWithHandlerAdvice.class.getName());
|
||||
ApacheHttpClientInstrumentation.class.getName() + "$UriRequestWithHandlerAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod()
|
||||
|
@ -103,7 +103,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(0, named("org.apache.http.client.methods.HttpUriRequest")))
|
||||
.and(takesArgument(1, named("org.apache.http.client.ResponseHandler")))
|
||||
.and(takesArgument(2, named("org.apache.http.protocol.HttpContext"))),
|
||||
UriRequestWithHandlerAdvice.class.getName());
|
||||
ApacheHttpClientInstrumentation.class.getName() + "$UriRequestWithHandlerAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod()
|
||||
|
@ -112,7 +112,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArguments(2))
|
||||
.and(takesArgument(0, named("org.apache.http.HttpHost")))
|
||||
.and(takesArgument(1, named("org.apache.http.HttpRequest"))),
|
||||
RequestAdvice.class.getName());
|
||||
ApacheHttpClientInstrumentation.class.getName() + "$RequestAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod()
|
||||
|
@ -122,7 +122,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(0, named("org.apache.http.HttpHost")))
|
||||
.and(takesArgument(1, named("org.apache.http.HttpRequest")))
|
||||
.and(takesArgument(2, named("org.apache.http.protocol.HttpContext"))),
|
||||
RequestAdvice.class.getName());
|
||||
ApacheHttpClientInstrumentation.class.getName() + "$RequestAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod()
|
||||
|
@ -132,7 +132,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(0, named("org.apache.http.HttpHost")))
|
||||
.and(takesArgument(1, named("org.apache.http.HttpRequest")))
|
||||
.and(takesArgument(2, named("org.apache.http.client.ResponseHandler"))),
|
||||
RequestWithHandlerAdvice.class.getName());
|
||||
ApacheHttpClientInstrumentation.class.getName() + "$RequestWithHandlerAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod()
|
||||
|
@ -143,7 +143,7 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(1, named("org.apache.http.HttpRequest")))
|
||||
.and(takesArgument(2, named("org.apache.http.client.ResponseHandler")))
|
||||
.and(takesArgument(3, named("org.apache.http.protocol.HttpContext"))),
|
||||
RequestWithHandlerAdvice.class.getName());
|
||||
ApacheHttpClientInstrumentation.class.getName() + "$RequestWithHandlerAdvice");
|
||||
|
||||
return transformers;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,8 @@ public final class AWSClientInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(isConstructor(), AWSClientAdvice.class.getName());
|
||||
return singletonMap(
|
||||
isConstructor(), AWSClientInstrumentation.class.getName() + "$AWSClientAdvice");
|
||||
}
|
||||
|
||||
public static class AWSClientAdvice {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class AWSHttpClientInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(not(isAbstract())).and(named("doExecute")),
|
||||
HttpClientAdvice.class.getName());
|
||||
AWSHttpClientInstrumentation.class.getName() + "$HttpClientAdvice");
|
||||
}
|
||||
|
||||
public static class HttpClientAdvice {
|
||||
|
@ -87,7 +87,7 @@ public class AWSHttpClientInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(not(isAbstract())).and(named("doExecute")),
|
||||
RequestExecutorAdvice.class.getName());
|
||||
RequestExecutorInstrumentation.class.getName() + "$RequestExecutorAdvice");
|
||||
}
|
||||
|
||||
public static class RequestExecutorAdvice {
|
||||
|
|
|
@ -30,7 +30,8 @@ public final class AwsClientInstrumentation extends AbstractAwsClientInstrumenta
|
|||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(isPublic()).and(named("build")), AwsBuilderAdvice.class.getName());
|
||||
isMethod().and(isPublic()).and(named("build")),
|
||||
AwsClientInstrumentation.class.getName() + "$AwsBuilderAdvice");
|
||||
}
|
||||
|
||||
public static class AwsBuilderAdvice {
|
||||
|
|
|
@ -39,7 +39,8 @@ public final class AwsHttpClientInstrumentation extends AbstractAwsClientInstrum
|
|||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return Collections.singletonMap(
|
||||
isMethod().and(isPublic()).and(named("execute")), AwsHttpClientAdvice.class.getName());
|
||||
isMethod().and(isPublic()).and(named("execute")),
|
||||
AwsHttpClientInstrumentation.class.getName() + "$AwsHttpClientAdvice");
|
||||
}
|
||||
|
||||
public static class AwsHttpClientAdvice {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class CouchbaseBucketInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(isPublic()).and(returns(named("rx.Observable"))),
|
||||
CouchbaseClientAdvice.class.getName());
|
||||
CouchbaseBucketInstrumentation.class.getName() + "$CouchbaseClientAdvice");
|
||||
}
|
||||
|
||||
public static class CouchbaseClientAdvice {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class CouchbaseClusterInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(isPublic()).and(returns(named("rx.Observable"))).and(not(named("core"))),
|
||||
CouchbaseClientAdvice.class.getName());
|
||||
CouchbaseClusterInstrumentation.class.getName() + "$CouchbaseClientAdvice");
|
||||
}
|
||||
|
||||
public static class CouchbaseClientAdvice {
|
||||
|
|
|
@ -47,7 +47,7 @@ public class CouchbaseCoreInstrumentation extends Instrumenter.Default {
|
|||
.and(isPublic())
|
||||
.and(takesArgument(0, named("com.couchbase.client.core.message.CouchbaseRequest")))
|
||||
.and(named("send")),
|
||||
CouchbaseCoreAdvice.class.getName());
|
||||
CouchbaseCoreInstrumentation.class.getName() + "$CouchbaseCoreAdvice");
|
||||
}
|
||||
|
||||
public static class CouchbaseCoreAdvice {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class CouchbaseNetworkInstrumentation extends Instrumenter.Default {
|
|||
takesArgument(
|
||||
0, named("com.couchbase.client.deps.io.netty.channel.ChannelHandlerContext")))
|
||||
.and(takesArgument(2, named("java.util.List"))),
|
||||
CouchbaseNetworkAdvice.class.getName());
|
||||
CouchbaseNetworkInstrumentation.class.getName() + "$CouchbaseNetworkAdvice");
|
||||
}
|
||||
|
||||
public static class CouchbaseNetworkAdvice {
|
||||
|
|
|
@ -44,7 +44,7 @@ public class CassandraClientInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(isPrivate()).and(named("newSession")).and(takesArguments(0)),
|
||||
CassandraClientAdvice.class.getName());
|
||||
CassandraClientInstrumentation.class.getName() + "$CassandraClientAdvice");
|
||||
}
|
||||
|
||||
public static class CassandraClientAdvice {
|
||||
|
|
|
@ -44,7 +44,7 @@ public final class DropwizardViewInstrumentation extends Instrumenter.Default {
|
|||
.and(named("render"))
|
||||
.and(takesArgument(0, named("io.dropwizard.views.View")))
|
||||
.and(isPublic()),
|
||||
RenderAdvice.class.getName());
|
||||
DropwizardViewInstrumentation.class.getName() + "$RenderAdvice");
|
||||
}
|
||||
|
||||
public static class RenderAdvice {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class Elasticsearch5RestClientInstrumentation extends Instrumenter.Defaul
|
|||
.and(takesArgument(0, named("java.lang.String"))) // method
|
||||
.and(takesArgument(1, named("java.lang.String"))) // endpoint
|
||||
.and(takesArgument(5, named("org.elasticsearch.client.ResponseListener"))),
|
||||
ElasticsearchRestClientAdvice.class.getName());
|
||||
Elasticsearch5RestClientInstrumentation.class.getName() + "$ElasticsearchRestClientAdvice");
|
||||
}
|
||||
|
||||
public static class ElasticsearchRestClientAdvice {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class Elasticsearch6RestClientInstrumentation extends Instrumenter.Defaul
|
|||
.and(takesArguments(2))
|
||||
.and(takesArgument(0, named("org.elasticsearch.client.Request")))
|
||||
.and(takesArgument(1, named("org.elasticsearch.client.ResponseListener"))),
|
||||
ElasticsearchRestClientAdvice.class.getName());
|
||||
Elasticsearch6RestClientInstrumentation.class.getName() + "$ElasticsearchRestClientAdvice");
|
||||
}
|
||||
|
||||
public static class ElasticsearchRestClientAdvice {
|
||||
|
|
|
@ -62,7 +62,8 @@ public class Elasticsearch2TransportClientInstrumentation extends Instrumenter.D
|
|||
.and(takesArgument(0, named("org.elasticsearch.action.Action")))
|
||||
.and(takesArgument(1, named("org.elasticsearch.action.ActionRequest")))
|
||||
.and(takesArgument(2, named("org.elasticsearch.action.ActionListener"))),
|
||||
ElasticsearchTransportClientAdvice.class.getName());
|
||||
Elasticsearch2TransportClientInstrumentation.class.getName()
|
||||
+ "$ElasticsearchTransportClientAdvice");
|
||||
}
|
||||
|
||||
public static class ElasticsearchTransportClientAdvice {
|
||||
|
|
|
@ -63,7 +63,8 @@ public class Elasticsearch53TransportClientInstrumentation extends Instrumenter.
|
|||
.and(takesArgument(0, named("org.elasticsearch.action.Action")))
|
||||
.and(takesArgument(1, named("org.elasticsearch.action.ActionRequest")))
|
||||
.and(takesArgument(2, named("org.elasticsearch.action.ActionListener"))),
|
||||
ElasticsearchTransportClientAdvice.class.getName());
|
||||
Elasticsearch53TransportClientInstrumentation.class.getName()
|
||||
+ "$ElasticsearchTransportClientAdvice");
|
||||
}
|
||||
|
||||
public static class ElasticsearchTransportClientAdvice {
|
||||
|
|
|
@ -62,7 +62,8 @@ public class Elasticsearch5TransportClientInstrumentation extends Instrumenter.D
|
|||
.and(takesArgument(0, named("org.elasticsearch.action.Action")))
|
||||
.and(takesArgument(1, named("org.elasticsearch.action.ActionRequest")))
|
||||
.and(takesArgument(2, named("org.elasticsearch.action.ActionListener"))),
|
||||
ElasticsearchTransportClientAdvice.class.getName());
|
||||
Elasticsearch5TransportClientInstrumentation.class.getName()
|
||||
+ "$ElasticsearchTransportClientAdvice");
|
||||
}
|
||||
|
||||
public static class ElasticsearchTransportClientAdvice {
|
||||
|
|
|
@ -66,7 +66,8 @@ public class Elasticsearch6TransportClientInstrumentation extends Instrumenter.D
|
|||
.and(takesArgument(0, named("org.elasticsearch.action.Action")))
|
||||
.and(takesArgument(1, named("org.elasticsearch.action.ActionRequest")))
|
||||
.and(takesArgument(2, named("org.elasticsearch.action.ActionListener"))),
|
||||
Elasticsearch6TransportClientAdvice.class.getName());
|
||||
Elasticsearch6TransportClientInstrumentation.class.getName()
|
||||
+ "$Elasticsearch6TransportClientAdvice");
|
||||
}
|
||||
|
||||
public static class Elasticsearch6TransportClientAdvice {
|
||||
|
|
|
@ -47,7 +47,7 @@ public final class GlassFishInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(named("addToBlackList")).and(takesArguments(1)),
|
||||
AvoidGlassFishBlacklistAdvice.class.getName());
|
||||
GlassFishInstrumentation.class.getName() + "$AvoidGlassFishBlacklistAdvice");
|
||||
}
|
||||
|
||||
public static class AvoidGlassFishBlacklistAdvice {
|
||||
|
|
|
@ -101,6 +101,7 @@ class GlassFishServerTest extends HttpServerTest<GlassFish, Servlet3Decorator> {
|
|||
}
|
||||
tags {
|
||||
"servlet.context" "/$context"
|
||||
"servlet.path" endpoint.path
|
||||
"span.origin.type" { it.startsWith("TestServlets\$") || it == DefaultServlet.name }
|
||||
|
||||
defaultTags(true)
|
||||
|
|
|
@ -64,7 +64,7 @@ public class GoogleHttpClientInstrumentation extends Instrumenter.Default {
|
|||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
isMethod().and(isPublic()).and(named("execute")).and(takesArguments(0)),
|
||||
GoogleHttpClientAdvice.class.getName());
|
||||
GoogleHttpClientInstrumentation.class.getName() + "$GoogleHttpClientAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod()
|
||||
|
@ -72,7 +72,7 @@ public class GoogleHttpClientInstrumentation extends Instrumenter.Default {
|
|||
.and(named("executeAsync"))
|
||||
.and(takesArguments(1))
|
||||
.and(takesArgument(0, (named("java.util.concurrent.Executor")))),
|
||||
GoogleHttpClientAsyncAdvice.class.getName());
|
||||
GoogleHttpClientInstrumentation.class.getName() + "$GoogleHttpClientAsyncAdvice");
|
||||
|
||||
return transformers;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class GrizzlyHttpHandlerInstrumentation extends Instrumenter.Default {
|
|||
.and(named("doHandle"))
|
||||
.and(takesArgument(0, named("org.glassfish.grizzly.http.server.Request")))
|
||||
.and(takesArgument(1, named("org.glassfish.grizzly.http.server.Response"))),
|
||||
HandleAdvice.class.getName());
|
||||
GrizzlyHttpHandlerInstrumentation.class.getName() + "$HandleAdvice");
|
||||
}
|
||||
|
||||
public static class HandleAdvice {
|
||||
|
|
|
@ -11,7 +11,7 @@ buildscript {
|
|||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6'
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,9 @@ public class GrpcClientBuilderInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(isMethod().and(named("build")), AddInterceptorAdvice.class.getName());
|
||||
return singletonMap(
|
||||
isMethod().and(named("build")),
|
||||
GrpcClientBuilderInstrumentation.class.getName() + "$AddInterceptorAdvice");
|
||||
}
|
||||
|
||||
public static class AddInterceptorAdvice {
|
||||
|
|
|
@ -41,7 +41,9 @@ public class GrpcServerBuilderInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(isMethod().and(named("build")), AddInterceptorAdvice.class.getName());
|
||||
return singletonMap(
|
||||
isMethod().and(named("build")),
|
||||
GrpcServerBuilderInstrumentation.class.getName() + "$AddInterceptorAdvice");
|
||||
}
|
||||
|
||||
public static class AddInterceptorAdvice {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class CriteriaInstrumentation extends AbstractHibernateInstrumentation {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(named("list").or(named("uniqueResult")).or(named("scroll"))),
|
||||
CriteriaMethodAdvice.class.getName());
|
||||
CriteriaInstrumentation.class.getName() + "$CriteriaMethodAdvice");
|
||||
}
|
||||
|
||||
public static class CriteriaMethodAdvice extends V3Advice {
|
||||
|
|
|
@ -45,7 +45,7 @@ public class QueryInstrumentation extends AbstractHibernateInstrumentation {
|
|||
.or(named("executeUpdate"))
|
||||
.or(named("uniqueResult"))
|
||||
.or(named("scroll"))),
|
||||
QueryMethodAdvice.class.getName());
|
||||
QueryInstrumentation.class.getName() + "$QueryMethodAdvice");
|
||||
}
|
||||
|
||||
public static class QueryMethodAdvice extends V3Advice {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SessionFactoryInstrumentation extends AbstractHibernateInstrumentat
|
|||
named("org.hibernate.Session")
|
||||
.or(named("org.hibernate.StatelessSession"))
|
||||
.or(safeHasSuperType(named("org.hibernate.Session"))))),
|
||||
SessionFactoryAdvice.class.getName());
|
||||
SessionFactoryInstrumentation.class.getName() + "$SessionFactoryAdvice");
|
||||
}
|
||||
|
||||
public static class SessionFactoryAdvice extends V3Advice {
|
||||
|
|
|
@ -58,7 +58,8 @@ public class SessionInstrumentation extends AbstractHibernateInstrumentation {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
isMethod().and(named("close")).and(takesArguments(0)), SessionCloseAdvice.class.getName());
|
||||
isMethod().and(named("close")).and(takesArguments(0)),
|
||||
SessionInstrumentation.class.getName() + "$SessionCloseAdvice");
|
||||
|
||||
// Session synchronous methods we want to instrument.
|
||||
transformers.put(
|
||||
|
@ -79,14 +80,15 @@ public class SessionInstrumentation extends AbstractHibernateInstrumentation {
|
|||
// Lazy-load methods.
|
||||
.or(named("immediateLoad"))
|
||||
.or(named("internalLoad"))),
|
||||
SessionMethodAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$SessionMethodAdvice");
|
||||
|
||||
// Handle the non-generic 'get' separately.
|
||||
transformers.put(
|
||||
isMethod()
|
||||
.and(named("get"))
|
||||
.and(returns(named("java.lang.Object")))
|
||||
.and(takesArgument(0, named("java.lang.String"))),
|
||||
SessionMethodAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$SessionMethodAdvice");
|
||||
|
||||
// These methods return some object that we want to instrument, and so the Advice will pin the
|
||||
// current Span to the returned object using a ContextStore.
|
||||
|
@ -94,15 +96,15 @@ public class SessionInstrumentation extends AbstractHibernateInstrumentation {
|
|||
isMethod()
|
||||
.and(named("beginTransaction").or(named("getTransaction")))
|
||||
.and(returns(named("org.hibernate.Transaction"))),
|
||||
GetTransactionAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$GetTransactionAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod().and(returns(safeHasSuperType(named("org.hibernate.Query")))),
|
||||
GetQueryAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$GetQueryAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod().and(returns(safeHasSuperType(named("org.hibernate.Criteria")))),
|
||||
GetCriteriaAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$GetCriteriaAdvice");
|
||||
|
||||
return transformers;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class TransactionInstrumentation extends AbstractHibernateInstrumentation
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(named("commit")).and(takesArguments(0)),
|
||||
TransactionCommitAdvice.class.getName());
|
||||
TransactionInstrumentation.class.getName() + "$TransactionCommitAdvice");
|
||||
}
|
||||
|
||||
public static class TransactionCommitAdvice extends V3Advice {
|
||||
|
|
|
@ -38,7 +38,7 @@ public class CriteriaInstrumentation extends AbstractHibernateInstrumentation {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(named("list").or(named("uniqueResult")).or(named("scroll"))),
|
||||
CriteriaMethodAdvice.class.getName());
|
||||
CriteriaInstrumentation.class.getName() + "$CriteriaMethodAdvice");
|
||||
}
|
||||
|
||||
public static class CriteriaMethodAdvice extends V4Advice {
|
||||
|
|
|
@ -45,7 +45,7 @@ public class QueryInstrumentation extends AbstractHibernateInstrumentation {
|
|||
.or(named("executeUpdate"))
|
||||
.or(named("uniqueResult"))
|
||||
.or(named("scroll"))),
|
||||
QueryMethodAdvice.class.getName());
|
||||
QueryInstrumentation.class.getName() + "$QueryMethodAdvice");
|
||||
}
|
||||
|
||||
public static class QueryMethodAdvice extends V4Advice {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class SessionFactoryInstrumentation extends AbstractHibernateInstrumentat
|
|||
.and(
|
||||
returns(
|
||||
named("org.hibernate.Session").or(named("org.hibernate.StatelessSession")))),
|
||||
SessionFactoryAdvice.class.getName());
|
||||
SessionFactoryInstrumentation.class.getName() + "$SessionFactoryAdvice");
|
||||
}
|
||||
|
||||
public static class SessionFactoryAdvice extends V4Advice {
|
||||
|
|
|
@ -53,7 +53,8 @@ public class SessionInstrumentation extends AbstractHibernateInstrumentation {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
isMethod().and(named("close")).and(takesArguments(0)), SessionCloseAdvice.class.getName());
|
||||
isMethod().and(named("close")).and(takesArguments(0)),
|
||||
SessionInstrumentation.class.getName() + "$SessionCloseAdvice");
|
||||
|
||||
// Session synchronous methods we want to instrument.
|
||||
transformers.put(
|
||||
|
@ -74,14 +75,14 @@ public class SessionInstrumentation extends AbstractHibernateInstrumentation {
|
|||
// Lazy-load methods.
|
||||
.or(named("immediateLoad"))
|
||||
.or(named("internalLoad"))),
|
||||
SessionMethodAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$SessionMethodAdvice");
|
||||
// Handle the non-generic 'get' separately.
|
||||
transformers.put(
|
||||
isMethod()
|
||||
.and(named("get"))
|
||||
.and(returns(named("java.lang.Object")))
|
||||
.and(takesArgument(0, named("java.lang.String"))),
|
||||
SessionMethodAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$SessionMethodAdvice");
|
||||
|
||||
// These methods return some object that we want to instrument, and so the Advice will pin the
|
||||
// current Span to the returned object using a ContextStore.
|
||||
|
@ -89,15 +90,15 @@ public class SessionInstrumentation extends AbstractHibernateInstrumentation {
|
|||
isMethod()
|
||||
.and(named("beginTransaction").or(named("getTransaction")))
|
||||
.and(returns(named("org.hibernate.Transaction"))),
|
||||
GetTransactionAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$GetTransactionAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod().and(returns(safeHasSuperType(named("org.hibernate.Query")))),
|
||||
GetQueryAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$GetQueryAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod().and(returns(safeHasSuperType(named("org.hibernate.Criteria")))),
|
||||
GetCriteriaAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$GetCriteriaAdvice");
|
||||
|
||||
return transformers;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class TransactionInstrumentation extends AbstractHibernateInstrumentation
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(named("commit")).and(takesArguments(0)),
|
||||
TransactionCommitAdvice.class.getName());
|
||||
TransactionInstrumentation.class.getName() + "$TransactionCommitAdvice");
|
||||
}
|
||||
|
||||
public static class TransactionCommitAdvice extends V4Advice {
|
||||
|
|
|
@ -53,7 +53,8 @@ public class ProcedureCallInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(named("getOutputs")), ProcedureCallMethodAdvice.class.getName());
|
||||
isMethod().and(named("getOutputs")),
|
||||
ProcedureCallInstrumentation.class.getName() + "$ProcedureCallMethodAdvice");
|
||||
}
|
||||
|
||||
public static class ProcedureCallMethodAdvice {
|
||||
|
|
|
@ -62,7 +62,7 @@ public class SessionInstrumentation extends Instrumenter.Default {
|
|||
|
||||
transformers.put(
|
||||
isMethod().and(returns(safeHasSuperType(named("org.hibernate.procedure.ProcedureCall")))),
|
||||
GetProcedureCallAdvice.class.getName());
|
||||
SessionInstrumentation.class.getName() + "$GetProcedureCallAdvice");
|
||||
|
||||
return transformers;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public class HttpUrlConnectionInstrumentation extends Instrumenter.Default {
|
|||
isMethod()
|
||||
.and(isPublic())
|
||||
.and(named("connect").or(named("getOutputStream")).or(named("getInputStream"))),
|
||||
HttpUrlConnectionAdvice.class.getName());
|
||||
HttpUrlConnectionInstrumentation.class.getName() + "$HttpUrlConnectionAdvice");
|
||||
}
|
||||
|
||||
public static class HttpUrlConnectionAdvice {
|
||||
|
|
|
@ -3,10 +3,7 @@ package datadog.trace.instrumentation.http_url_connection;
|
|||
import static datadog.trace.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.instrumentation.api.AgentTracer.startSpan;
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.is;
|
||||
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.*;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import datadog.trace.agent.tooling.Instrumenter;
|
||||
|
@ -43,7 +40,7 @@ public class UrlInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(isPublic()).and(named("openConnection")),
|
||||
ConnectionErrorAdvice.class.getName());
|
||||
UrlInstrumentation.class.getName() + "$ConnectionErrorAdvice");
|
||||
}
|
||||
|
||||
public static class ConnectionErrorAdvice {
|
||||
|
|
|
@ -52,10 +52,10 @@ public class HystrixInstrumentation extends Instrumenter.Default {
|
|||
final Map<ElementMatcher.Junction<MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("getExecutionObservable").and(returns(named("rx.Observable"))),
|
||||
ExecuteAdvice.class.getName());
|
||||
HystrixInstrumentation.class.getName() + "$ExecuteAdvice");
|
||||
transformers.put(
|
||||
named("getFallbackObservable").and(returns(named("rx.Observable"))),
|
||||
FallbackAdvice.class.getName());
|
||||
HystrixInstrumentation.class.getName() + "$FallbackAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class HystrixThreadPoolInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(named("schedule")).and(takesArguments(1)),
|
||||
EnableAsyncAdvice.class.getName());
|
||||
HystrixThreadPoolInstrumentation.class.getName() + "$EnableAsyncAdvice");
|
||||
}
|
||||
|
||||
public static class EnableAsyncAdvice {
|
||||
|
|
|
@ -89,6 +89,3 @@ shadowJar {
|
|||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
classifier = 'unbundled'
|
||||
}
|
||||
|
|
|
@ -41,15 +41,15 @@ public final class AkkaExecutorInstrumentation extends AbstractExecutorInstrumen
|
|||
transformers.put(
|
||||
named("execute")
|
||||
.and(takesArgument(0, named(AkkaForkJoinTaskInstrumentation.TASK_CLASS_NAME))),
|
||||
SetAkkaForkJoinStateAdvice.class.getName());
|
||||
AkkaExecutorInstrumentation.class.getName() + "$SetAkkaForkJoinStateAdvice");
|
||||
transformers.put(
|
||||
named("submit")
|
||||
.and(takesArgument(0, named(AkkaForkJoinTaskInstrumentation.TASK_CLASS_NAME))),
|
||||
SetAkkaForkJoinStateAdvice.class.getName());
|
||||
AkkaExecutorInstrumentation.class.getName() + "$SetAkkaForkJoinStateAdvice");
|
||||
transformers.put(
|
||||
nameMatches("invoke")
|
||||
.and(takesArgument(0, named(AkkaForkJoinTaskInstrumentation.TASK_CLASS_NAME))),
|
||||
SetAkkaForkJoinStateAdvice.class.getName());
|
||||
AkkaExecutorInstrumentation.class.getName() + "$SetAkkaForkJoinStateAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ public final class AkkaForkJoinTaskInstrumentation extends Instrumenter.Default
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
named("exec").and(takesArguments(0)).and(not(isAbstract())),
|
||||
ForkJoinTaskAdvice.class.getName());
|
||||
AkkaForkJoinTaskInstrumentation.class.getName() + "$ForkJoinTaskAdvice");
|
||||
}
|
||||
|
||||
public static class ForkJoinTaskAdvice {
|
||||
|
|
|
@ -78,7 +78,9 @@ public final class AsyncPropagatingDisableInstrumentation implements Instrumente
|
|||
|
||||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(methodMatcher, DisableAsyncAdvice.class.getName());
|
||||
return singletonMap(
|
||||
methodMatcher,
|
||||
AsyncPropagatingDisableInstrumentation.class.getName() + "$DisableAsyncAdvice");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,8 @@ public final class FutureInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
named("cancel").and(returns(boolean.class)), CanceledFutureAdvice.class.getName());
|
||||
named("cancel").and(returns(boolean.class)),
|
||||
FutureInstrumentation.class.getName() + "$CanceledFutureAdvice");
|
||||
}
|
||||
|
||||
public static class CanceledFutureAdvice {
|
||||
|
|
|
@ -44,31 +44,32 @@ public final class JavaExecutorInstrumentation extends AbstractExecutorInstrumen
|
|||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("execute").and(takesArgument(0, Runnable.class)),
|
||||
SetExecuteRunnableStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetExecuteRunnableStateAdvice");
|
||||
transformers.put(
|
||||
named("execute").and(takesArgument(0, ForkJoinTask.class)),
|
||||
SetJavaForkJoinStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetJavaForkJoinStateAdvice");
|
||||
transformers.put(
|
||||
named("submit").and(takesArgument(0, Runnable.class)),
|
||||
SetSubmitRunnableStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetSubmitRunnableStateAdvice");
|
||||
transformers.put(
|
||||
named("submit").and(takesArgument(0, Callable.class)),
|
||||
SetCallableStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetCallableStateAdvice");
|
||||
transformers.put(
|
||||
named("submit").and(takesArgument(0, ForkJoinTask.class)),
|
||||
SetJavaForkJoinStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetJavaForkJoinStateAdvice");
|
||||
transformers.put(
|
||||
nameMatches("invoke(Any|All)$").and(takesArgument(0, Collection.class)),
|
||||
SetCallableStateForCallableCollectionAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName()
|
||||
+ "$SetCallableStateForCallableCollectionAdvice");
|
||||
transformers.put(
|
||||
nameMatches("invoke").and(takesArgument(0, ForkJoinTask.class)),
|
||||
SetJavaForkJoinStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetJavaForkJoinStateAdvice");
|
||||
transformers.put(
|
||||
named("schedule").and(takesArgument(0, Runnable.class)),
|
||||
SetSubmitRunnableStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetSubmitRunnableStateAdvice");
|
||||
transformers.put(
|
||||
named("schedule").and(takesArgument(0, Callable.class)),
|
||||
SetCallableStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetCallableStateAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public final class JavaForkJoinTaskInstrumentation extends Instrumenter.Default
|
|||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("exec").and(takesArguments(0)).and(not(isAbstract())),
|
||||
ForkJoinTaskAdvice.class.getName());
|
||||
JavaForkJoinTaskInstrumentation.class.getName() + "$ForkJoinTaskAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,10 +32,11 @@ public final class NonStandardExecutorInstrumentation extends AbstractExecutorIn
|
|||
named("dispatch")
|
||||
.and(takesArgument(0, Runnable.class))
|
||||
.and(takesArgument(1, named("kotlinx.coroutines.scheduling.TaskContext"))),
|
||||
JavaExecutorInstrumentation.SetExecuteRunnableStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetExecuteRunnableStateAdvice");
|
||||
|
||||
transformers.put( // org.eclipse.jetty.util.thread.QueuedThreadPool
|
||||
named("dispatch").and(takesArguments(1)).and(takesArgument(0, Runnable.class)),
|
||||
JavaExecutorInstrumentation.SetExecuteRunnableStateAdvice.class.getName());
|
||||
JavaExecutorInstrumentation.class.getName() + "$SetExecuteRunnableStateAdvice");
|
||||
return transformers;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,9 +57,11 @@ public final class RunnableCallableInstrumentation extends Instrumenter.Default
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("run").and(takesArguments(0)).and(isPublic()), RunnableAdvice.class.getName());
|
||||
named("run").and(takesArguments(0)).and(isPublic()),
|
||||
RunnableCallableInstrumentation.class.getName() + "$RunnableAdvice");
|
||||
transformers.put(
|
||||
named("call").and(takesArguments(0)).and(isPublic()), CallableAdvice.class.getName());
|
||||
named("call").and(takesArguments(0)).and(isPublic()),
|
||||
RunnableCallableInstrumentation.class.getName() + "$CallableAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,15 +41,15 @@ public final class ScalaExecutorInstrumentation extends AbstractExecutorInstrume
|
|||
transformers.put(
|
||||
named("execute")
|
||||
.and(takesArgument(0, named(ScalaForkJoinTaskInstrumentation.TASK_CLASS_NAME))),
|
||||
SetScalaForkJoinStateAdvice.class.getName());
|
||||
ScalaExecutorInstrumentation.class.getName() + "$SetScalaForkJoinStateAdvice");
|
||||
transformers.put(
|
||||
named("submit")
|
||||
.and(takesArgument(0, named(ScalaForkJoinTaskInstrumentation.TASK_CLASS_NAME))),
|
||||
SetScalaForkJoinStateAdvice.class.getName());
|
||||
ScalaExecutorInstrumentation.class.getName() + "$SetScalaForkJoinStateAdvice");
|
||||
transformers.put(
|
||||
nameMatches("invoke")
|
||||
.and(takesArgument(0, named(ScalaForkJoinTaskInstrumentation.TASK_CLASS_NAME))),
|
||||
SetScalaForkJoinStateAdvice.class.getName());
|
||||
ScalaExecutorInstrumentation.class.getName() + "$SetScalaForkJoinStateAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ public final class ScalaForkJoinTaskInstrumentation extends Instrumenter.Default
|
|||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("exec").and(takesArguments(0)).and(not(isAbstract())),
|
||||
ForkJoinTaskAdvice.class.getName());
|
||||
ScalaForkJoinTaskInstrumentation.class.getName() + "$ForkJoinTaskAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ThreadPoolExecutorInstrumentation extends Instrumenter.Default {
|
|||
isConstructor()
|
||||
.and(takesArgument(4, named("java.util.concurrent.BlockingQueue")))
|
||||
.and(takesArguments(7)),
|
||||
ThreadPoolExecutorAdvice.class.getName());
|
||||
ThreadPoolExecutorInstrumentation.class.getName() + "$ThreadPoolExecutorAdvice");
|
||||
}
|
||||
|
||||
public static class ThreadPoolExecutorAdvice {
|
||||
|
|
|
@ -63,7 +63,7 @@ public final class JaxRsAnnotationsInstrumentation extends Instrumenter.Default
|
|||
.or(named("javax.ws.rs.OPTIONS"))
|
||||
.or(named("javax.ws.rs.POST"))
|
||||
.or(named("javax.ws.rs.PUT"))),
|
||||
JaxRsAnnotationsAdvice.class.getName());
|
||||
JaxRsAnnotationsInstrumentation.class.getName() + "$JaxRsAnnotationsAdvice");
|
||||
}
|
||||
|
||||
public static class JaxRsAnnotationsAdvice {
|
||||
|
|
|
@ -62,7 +62,7 @@ public final class JaxRsAnnotationsInstrumentation extends Instrumenter.Default
|
|||
.or(named("javax.ws.rs.OPTIONS"))
|
||||
.or(named("javax.ws.rs.POST"))
|
||||
.or(named("javax.ws.rs.PUT"))),
|
||||
JaxRsAnnotationsAdvice.class.getName());
|
||||
JaxRsAnnotationsInstrumentation.class.getName() + "$JaxRsAnnotationsAdvice");
|
||||
}
|
||||
|
||||
public static class JaxRsAnnotationsAdvice {
|
||||
|
|
|
@ -50,11 +50,13 @@ public final class JaxRsAsyncResponseInstrumentation extends Instrumenter.Defaul
|
|||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("resume").and(takesArgument(0, Object.class)).and(isPublic()),
|
||||
AsyncResponseAdvice.class.getName());
|
||||
JaxRsAsyncResponseInstrumentation.class.getName() + "$AsyncResponseAdvice");
|
||||
transformers.put(
|
||||
named("resume").and(takesArgument(0, Throwable.class)).and(isPublic()),
|
||||
AsyncResponseThrowableAdvice.class.getName());
|
||||
transformers.put(named("cancel"), AsyncResponseCancelAdvice.class.getName());
|
||||
JaxRsAsyncResponseInstrumentation.class.getName() + "$AsyncResponseThrowableAdvice");
|
||||
transformers.put(
|
||||
named("cancel"),
|
||||
JaxRsAsyncResponseInstrumentation.class.getName() + "$AsyncResponseCancelAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public final class JaxRsClientV1Instrumentation extends Instrumenter.Default {
|
|||
takesArgument(
|
||||
0, safeHasSuperType(named("com.sun.jersey.api.client.ClientRequest"))))
|
||||
.and(returns(safeHasSuperType(named("com.sun.jersey.api.client.ClientResponse")))),
|
||||
HandleAdvice.class.getName());
|
||||
JaxRsClientV1Instrumentation.class.getName() + "$HandleAdvice");
|
||||
}
|
||||
|
||||
public static class HandleAdvice {
|
||||
|
|
|
@ -47,10 +47,15 @@ public final class JerseyClientConnectionErrorInstrumentation extends Instrument
|
|||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(isMethod().and(isPublic()).and(named("invoke")), InvokeAdvice.class.getName());
|
||||
|
||||
transformers.put(
|
||||
isMethod().and(isPublic()).and(named("invoke")),
|
||||
JerseyClientConnectionErrorInstrumentation.class.getName() + "$InvokeAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod().and(isPublic()).and(named("submit")).and(returns(Future.class)),
|
||||
SubmitAdvice.class.getName());
|
||||
JerseyClientConnectionErrorInstrumentation.class.getName() + "$SubmitAdvice");
|
||||
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,10 +47,15 @@ public final class ResteasyClientConnectionErrorInstrumentation extends Instrume
|
|||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(isMethod().and(isPublic()).and(named("invoke")), InvokeAdvice.class.getName());
|
||||
|
||||
transformers.put(
|
||||
isMethod().and(isPublic()).and(named("invoke")),
|
||||
ResteasyClientConnectionErrorInstrumentation.class.getName() + "$InvokeAdvice");
|
||||
|
||||
transformers.put(
|
||||
isMethod().and(isPublic()).and(named("submit")).and(returns(Future.class)),
|
||||
SubmitAdvice.class.getName());
|
||||
ResteasyClientConnectionErrorInstrumentation.class.getName() + "$SubmitAdvice");
|
||||
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public final class JaxRsClientInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
named("build").and(returns(safeHasSuperType(named("javax.ws.rs.client.Client")))),
|
||||
ClientBuilderAdvice.class.getName());
|
||||
JaxRsClientInstrumentation.class.getName() + "$ClientBuilderAdvice");
|
||||
}
|
||||
|
||||
public static class ClientBuilderAdvice {
|
||||
|
|
|
@ -44,7 +44,7 @@ public final class ConnectionInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(0, String.class))
|
||||
// Also include CallableStatement, which is a sub type of PreparedStatement
|
||||
.and(returns(safeHasSuperType(named("java.sql.PreparedStatement")))),
|
||||
ConnectionPrepareAdvice.class.getName());
|
||||
ConnectionInstrumentation.class.getName() + "$ConnectionPrepareAdvice");
|
||||
}
|
||||
|
||||
public static class ConnectionPrepareAdvice {
|
||||
|
|
|
@ -55,7 +55,7 @@ public final class DriverInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(0, String.class))
|
||||
.and(takesArgument(1, Properties.class))
|
||||
.and(returns(named("java.sql.Connection"))),
|
||||
DriverAdvice.class.getName());
|
||||
DriverInstrumentation.class.getName() + "$DriverAdvice");
|
||||
}
|
||||
|
||||
public static class DriverAdvice {
|
||||
|
|
|
@ -65,7 +65,7 @@ public final class PreparedStatementInstrumentation extends Instrumenter.Default
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
nameStartsWith("execute").and(takesArguments(0)).and(isPublic()),
|
||||
PreparedStatementAdvice.class.getName());
|
||||
PreparedStatementInstrumentation.class.getName() + "$PreparedStatementAdvice");
|
||||
}
|
||||
|
||||
public static class PreparedStatementAdvice {
|
||||
|
|
|
@ -65,7 +65,7 @@ public final class StatementInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
nameStartsWith("execute").and(takesArgument(0, String.class)).and(isPublic()),
|
||||
StatementAdvice.class.getName());
|
||||
StatementInstrumentation.class.getName() + "$StatementAdvice");
|
||||
}
|
||||
|
||||
public static class StatementAdvice {
|
||||
|
|
|
@ -52,7 +52,7 @@ public final class JedisInstrumentation extends Instrumenter.Default {
|
|||
.and(isPublic())
|
||||
.and(named("sendCommand"))
|
||||
.and(takesArgument(1, named("redis.clients.jedis.Protocol$Command"))),
|
||||
JedisAdvice.class.getName());
|
||||
JedisInstrumentation.class.getName() + "$JedisAdvice");
|
||||
// FIXME: This instrumentation only incorporates sending the command, not processing the result.
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ public class JettyDecorator
|
|||
assert span != null;
|
||||
if (request != null) {
|
||||
span.setTag("servlet.context", request.getContextPath());
|
||||
span.setTag("servlet.path", request.getServletPath());
|
||||
}
|
||||
return super.onRequest(span, request);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,6 @@ public final class JettyHandlerInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(2, named("javax.servlet.http.HttpServletRequest")))
|
||||
.and(takesArgument(3, named("javax.servlet.http.HttpServletResponse")))
|
||||
.and(isPublic()),
|
||||
JettyHandlerAdvice.class.getName());
|
||||
packageName + ".JettyHandlerAdvice");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,10 +58,10 @@ public final class JMSMessageConsumerInstrumentation extends Instrumenter.Defaul
|
|||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("receive").and(takesArguments(0).or(takesArguments(1))).and(isPublic()),
|
||||
ConsumerAdvice.class.getName());
|
||||
JMSMessageConsumerInstrumentation.class.getName() + "$ConsumerAdvice");
|
||||
transformers.put(
|
||||
named("receiveNoWait").and(takesArguments(0)).and(isPublic()),
|
||||
ConsumerAdvice.class.getName());
|
||||
JMSMessageConsumerInstrumentation.class.getName() + "$ConsumerAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public final class JMSMessageListenerInstrumentation extends Instrumenter.Defaul
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
named("onMessage").and(takesArgument(0, named("javax.jms.Message"))).and(isPublic()),
|
||||
MessageListenerAdvice.class.getName());
|
||||
JMSMessageListenerInstrumentation.class.getName() + "$MessageListenerAdvice");
|
||||
}
|
||||
|
||||
public static class MessageListenerAdvice {
|
||||
|
|
|
@ -58,13 +58,13 @@ public final class JMSMessageProducerInstrumentation extends Instrumenter.Defaul
|
|||
final Map<ElementMatcher<? super MethodDescription>, String> transformers = new HashMap<>();
|
||||
transformers.put(
|
||||
named("send").and(takesArgument(0, named("javax.jms.Message"))).and(isPublic()),
|
||||
ProducerAdvice.class.getName());
|
||||
JMSMessageProducerInstrumentation.class.getName() + "$ProducerAdvice");
|
||||
transformers.put(
|
||||
named("send")
|
||||
.and(takesArgument(0, named("javax.jms.Destination")))
|
||||
.and(takesArgument(1, named("javax.jms.Message")))
|
||||
.and(isPublic()),
|
||||
ProducerWithDestinationAdvice.class.getName());
|
||||
JMSMessageProducerInstrumentation.class.getName() + "$ProducerWithDestinationAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public final class JSPInstrumentation extends Instrumenter.Default {
|
|||
.and(takesArgument(0, named("javax.servlet.http.HttpServletRequest")))
|
||||
.and(takesArgument(1, named("javax.servlet.http.HttpServletResponse")))
|
||||
.and(isPublic()),
|
||||
HttpJspPageAdvice.class.getName());
|
||||
JSPInstrumentation.class.getName() + "$HttpJspPageAdvice");
|
||||
}
|
||||
|
||||
public static class HttpJspPageAdvice {
|
||||
|
|
|
@ -42,7 +42,8 @@ public final class JasperJSPCompilationContextInstrumentation extends Instrument
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
named("compile").and(takesArguments(0)).and(isPublic()),
|
||||
JasperJspCompilationContext.class.getName());
|
||||
JasperJSPCompilationContextInstrumentation.class.getName()
|
||||
+ "$JasperJspCompilationContext");
|
||||
}
|
||||
|
||||
public static class JasperJspCompilationContext {
|
||||
|
|
|
@ -102,6 +102,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/$jspFileName"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -177,6 +178,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/getQuery.jsp"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -249,6 +251,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/post.jsp"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -318,6 +321,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/$jspFileName"
|
||||
"http.status_code" 500
|
||||
"error" true
|
||||
"error.type" { String tagExceptionType ->
|
||||
|
@ -408,6 +412,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/includes/includeHtml.jsp"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -476,6 +481,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/includes/includeMulti.jsp"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -600,6 +606,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/$jspFileName"
|
||||
"http.status_code" 500
|
||||
errorTags(JasperException, String)
|
||||
defaultTags()
|
||||
|
|
|
@ -101,6 +101,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/$forwardFromFileName"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -203,6 +204,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/forwards/forwardToHtml.jsp"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -271,6 +273,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/forwards/forwardToIncludeMulti.jsp"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -426,6 +429,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/forwards/forwardToJspForward.jsp"
|
||||
"http.status_code" 200
|
||||
defaultTags()
|
||||
}
|
||||
|
@ -552,6 +556,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/forwards/forwardToCompileError.jsp"
|
||||
"http.status_code" 500
|
||||
errorTags(JasperException, String)
|
||||
defaultTags()
|
||||
|
@ -637,6 +642,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
|
|||
"component" "java-web-servlet"
|
||||
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
|
||||
"servlet.context" "/$jspWebappContext"
|
||||
"servlet.path" "/forwards/forwardToNonExistent.jsp"
|
||||
"http.status_code" 404
|
||||
defaultTags()
|
||||
}
|
||||
|
|
|
@ -56,21 +56,21 @@ public final class KafkaConsumerInstrumentation extends Instrumenter.Default {
|
|||
.and(named("records"))
|
||||
.and(takesArgument(0, String.class))
|
||||
.and(returns(Iterable.class)),
|
||||
IterableAdvice.class.getName());
|
||||
KafkaConsumerInstrumentation.class.getName() + "$IterableAdvice");
|
||||
transformers.put(
|
||||
isMethod()
|
||||
.and(isPublic())
|
||||
.and(named("records"))
|
||||
.and(takesArgument(0, named("org.apache.kafka.common.TopicPartition")))
|
||||
.and(returns(List.class)),
|
||||
ListAdvice.class.getName());
|
||||
KafkaConsumerInstrumentation.class.getName() + "$ListAdvice");
|
||||
transformers.put(
|
||||
isMethod()
|
||||
.and(isPublic())
|
||||
.and(named("iterator"))
|
||||
.and(takesArguments(0))
|
||||
.and(returns(Iterator.class)),
|
||||
IteratorAdvice.class.getName());
|
||||
KafkaConsumerInstrumentation.class.getName() + "$IteratorAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public final class KafkaProducerInstrumentation extends Instrumenter.Default {
|
|||
.and(named("send"))
|
||||
.and(takesArgument(0, named("org.apache.kafka.clients.producer.ProducerRecord")))
|
||||
.and(takesArgument(1, named("org.apache.kafka.clients.producer.Callback"))),
|
||||
ProducerAdvice.class.getName());
|
||||
KafkaProducerInstrumentation.class.getName() + "$ProducerAdvice");
|
||||
}
|
||||
|
||||
public static class ProducerAdvice {
|
||||
|
|
|
@ -64,7 +64,7 @@ public class KafkaStreamsProcessorInstrumentation {
|
|||
.and(isPackagePrivate())
|
||||
.and(named("nextRecord"))
|
||||
.and(returns(named("org.apache.kafka.streams.processor.internals.StampedRecord"))),
|
||||
StartSpanAdvice.class.getName());
|
||||
StartInstrumentation.class.getName() + "$StartSpanAdvice");
|
||||
}
|
||||
|
||||
public static class StartSpanAdvice {
|
||||
|
@ -112,7 +112,7 @@ public class KafkaStreamsProcessorInstrumentation {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(isPublic()).and(named("process")).and(takesArguments(0)),
|
||||
StopSpanAdvice.class.getName());
|
||||
StopInstrumentation.class.getName() + "$StopSpanAdvice");
|
||||
}
|
||||
|
||||
public static class StopSpanAdvice {
|
||||
|
|
|
@ -38,7 +38,8 @@ public class KafkaStreamsSourceNodeRecordDeserializerInstrumentation extends Ins
|
|||
.and(named("deserialize"))
|
||||
.and(takesArgument(0, named("org.apache.kafka.clients.consumer.ConsumerRecord")))
|
||||
.and(returns(named("org.apache.kafka.clients.consumer.ConsumerRecord"))),
|
||||
SaveHeadersAdvice.class.getName());
|
||||
KafkaStreamsSourceNodeRecordDeserializerInstrumentation.class.getName()
|
||||
+ "$SaveHeadersAdvice");
|
||||
}
|
||||
|
||||
public static class SaveHeadersAdvice {
|
||||
|
|
|
@ -36,7 +36,8 @@ public class Log4j1MDCInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(isConstructor(), MDCContextAdvice.class.getName());
|
||||
return singletonMap(
|
||||
isConstructor(), Log4j1MDCInstrumentation.class.getName() + "$MDCContextAdvice");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -36,7 +36,8 @@ public class ThreadContextInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(isTypeInitializer(), ThreadContextAdvice.class.getName());
|
||||
return singletonMap(
|
||||
isTypeInitializer(), ThreadContextInstrumentation.class.getName() + "$ThreadContextAdvice");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -56,7 +56,7 @@ public final class MongoClientInstrumentation extends Instrumenter.Default {
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(isPublic()).and(named("build")).and(takesArguments(0)),
|
||||
MongoClientAdvice.class.getName());
|
||||
MongoClientInstrumentation.class.getName() + "$MongoClientAdvice");
|
||||
}
|
||||
|
||||
public static class MongoClientAdvice {
|
||||
|
|
|
@ -56,7 +56,7 @@ public final class MongoAsyncClientInstrumentation extends Instrumenter.Default
|
|||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
|
||||
return singletonMap(
|
||||
isMethod().and(isPublic()).and(named("build")).and(takesArguments(0)),
|
||||
MongoAsyncClientAdvice.class.getName());
|
||||
MongoAsyncClientInstrumentation.class.getName() + "$MongoAsyncClientAdvice");
|
||||
}
|
||||
|
||||
public static class MongoAsyncClientAdvice {
|
||||
|
|
|
@ -70,7 +70,7 @@ public class ChannelFutureListenerInstrumentation extends Instrumenter.Default {
|
|||
isMethod()
|
||||
.and(named("operationComplete"))
|
||||
.and(takesArgument(0, named("io.netty.channel.ChannelFuture"))),
|
||||
OperationCompleteAdvice.class.getName());
|
||||
ChannelFutureListenerInstrumentation.class.getName() + "$OperationCompleteAdvice");
|
||||
}
|
||||
|
||||
public static class OperationCompleteAdvice {
|
||||
|
|
|
@ -83,10 +83,10 @@ public class NettyChannelPipelineInstrumentation extends Instrumenter.Default {
|
|||
isMethod()
|
||||
.and(nameStartsWith("add"))
|
||||
.and(takesArgument(2, named("io.netty.channel.ChannelHandler"))),
|
||||
ChannelPipelineAddAdvice.class.getName());
|
||||
NettyChannelPipelineInstrumentation.class.getName() + "$ChannelPipelineAddAdvice");
|
||||
transformers.put(
|
||||
isMethod().and(named("connect")).and(returns(named("io.netty.channel.ChannelFuture"))),
|
||||
ChannelPipelineConnectAdvice.class.getName());
|
||||
NettyChannelPipelineInstrumentation.class.getName() + "$ChannelPipelineConnectAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public class ChannelFutureListenerInstrumentation extends Instrumenter.Default {
|
|||
isMethod()
|
||||
.and(named("operationComplete"))
|
||||
.and(takesArgument(0, named("io.netty.channel.ChannelFuture"))),
|
||||
OperationCompleteAdvice.class.getName());
|
||||
ChannelFutureListenerInstrumentation.class.getName() + "$OperationCompleteAdvice");
|
||||
}
|
||||
|
||||
public static class OperationCompleteAdvice {
|
||||
|
|
|
@ -83,10 +83,10 @@ public class NettyChannelPipelineInstrumentation extends Instrumenter.Default {
|
|||
isMethod()
|
||||
.and(nameStartsWith("add"))
|
||||
.and(takesArgument(2, named("io.netty.channel.ChannelHandler"))),
|
||||
ChannelPipelineAddAdvice.class.getName());
|
||||
NettyChannelPipelineInstrumentation.class.getName() + "$ChannelPipelineAddAdvice");
|
||||
transformers.put(
|
||||
isMethod().and(named("connect")).and(returns(named("io.netty.channel.ChannelFuture"))),
|
||||
ChannelPipelineConnectAdvice.class.getName());
|
||||
NettyChannelPipelineInstrumentation.class.getName() + "$ChannelPipelineConnectAdvice");
|
||||
return transformers;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue