Trask Stalnaker 5 éve
szülő
commit
8c558fa00e
25 módosított fájl, 76 hozzáadás és 75 törlés
  1. 0 1
      dd-java-agent/instrumentation/akka-http-10.0/src/lagomTest/java/EchoServiceImpl.java
  2. 2 2
      dd-java-agent/instrumentation/couchbase-2.6/couchbase-2.6.gradle
  3. 5 5
      dd-java-agent/instrumentation/elasticsearch/rest-5/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy
  4. 5 5
      dd-java-agent/instrumentation/elasticsearch/rest-5/src/test/groovy/Elasticsearch5RestClientTest.groovy
  5. 5 5
      dd-java-agent/instrumentation/elasticsearch/rest-6.4/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy
  6. 5 5
      dd-java-agent/instrumentation/elasticsearch/rest-6.4/src/test/groovy/Elasticsearch6RestClientTest.groovy
  7. 1 1
      dd-java-agent/instrumentation/elasticsearch/transport-2/transport-2.gradle
  8. 1 1
      dd-java-agent/instrumentation/google-http-client/google-http-client.gradle
  9. 2 2
      dd-java-agent/instrumentation/hystrix-1.4/hystrix-1.4.gradle
  10. 2 2
      dd-java-agent/instrumentation/instrumentation.gradle
  11. 6 6
      dd-java-agent/instrumentation/java-concurrent/kotlin-testing/src/test/kotlin/KotlinCoroutineTests.kt
  12. 1 1
      dd-java-agent/instrumentation/jax-rs-client-2.0/src/test/groovy/JaxRsClientAsyncTest.groovy
  13. 1 1
      dd-java-agent/instrumentation/jdbc/jdbc.gradle
  14. 2 2
      dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingIterable.java
  15. 1 1
      dd-java-agent/instrumentation/kafka-clients-0.11/src/test/groovy/KafkaClientTest.groovy
  16. 1 1
      dd-java-agent/instrumentation/mongo/driver-3.1/src/test/groovy/MongoClientTest.groovy
  17. 1 1
      dd-java-agent/instrumentation/mongo/driver-async-3.3/src/test/groovy/MongoAsyncClientTest.groovy
  18. 14 11
      dd-java-agent/instrumentation/spring-webflux-5/src/main/java8/datadog/trace/instrumentation/springwebflux/client/DefaultWebClientAdvice.java
  19. 15 15
      dd-java-agent/instrumentation/spring-webflux-5/src/main/java8/datadog/trace/instrumentation/springwebflux/client/TracingClientResponseSubscriber.java
  20. 1 1
      dd-java-agent/instrumentation/spring-webflux-5/src/test/groovy/dd/trace/instrumentation/springwebflux/client/SpringWebfluxHttpClientTest.groovy
  21. 0 1
      dd-java-agent/instrumentation/tomcat-classloading/tomcat-classloading.gradle
  22. 1 1
      dd-smoke-tests/dd-smoke-tests.gradle
  23. 2 2
      dd-smoke-tests/java9-modules/java9-modules.gradle
  24. 1 1
      dd-smoke-tests/springboot/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java
  25. 1 1
      gradle/java.gradle

+ 0 - 1
dd-java-agent/instrumentation/akka-http-10.0/src/lagomTest/java/EchoServiceImpl.java

@@ -23,5 +23,4 @@ public class EchoServiceImpl implements EchoService {
   public List<String> tracedMethod() {
     return java.util.Arrays.asList("msg1", "msg2", "msg3");
   }
-
 }

+ 2 - 2
dd-java-agent/instrumentation/couchbase-2.6/couchbase-2.6.gradle

@@ -45,7 +45,7 @@ muzzle {
 
 dependencies {
   compile project(':dd-java-agent:instrumentation:rxjava-1')
-  
+
   compileOnly group: 'com.couchbase.client', name: 'java-client', version: '2.6.0'
 
   testCompile project(':dd-java-agent:instrumentation:couchbase-2.0')
@@ -56,7 +56,7 @@ dependencies {
 
   testCompile group: 'com.couchbase.client', name: 'java-client', version: '2.6.0'
   testCompile group: 'com.couchbase.client', name: 'encryption', version: '1.0.0'
-  
+
   latestDepTestCompile group: 'org.springframework.data', name: 'spring-data-couchbase', version: '3.1+'
   latestDepTestCompile group: 'com.couchbase.client', name: 'java-client', version: '2.6+'
   latestDepTestCompile group: 'com.couchbase.client', name: 'encryption', version: '+'

+ 5 - 5
dd-java-agent/instrumentation/elasticsearch/rest-5/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy

@@ -51,11 +51,11 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
     client = RestClient.builder(new HttpHost("localhost", httpPort))
       .setMaxRetryTimeoutMillis(Integer.MAX_VALUE)
       .setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
-      @Override
-      RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
-        return builder.setConnectTimeout(Integer.MAX_VALUE).setSocketTimeout(Integer.MAX_VALUE)
-      }
-    })
+        @Override
+        RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
+          return builder.setConnectTimeout(Integer.MAX_VALUE).setSocketTimeout(Integer.MAX_VALUE)
+        }
+      })
       .build()
 
   }

+ 5 - 5
dd-java-agent/instrumentation/elasticsearch/rest-5/src/test/groovy/Elasticsearch5RestClientTest.groovy

@@ -56,11 +56,11 @@ class Elasticsearch5RestClientTest extends AgentTestRunner {
     client = RestClient.builder(new HttpHost("localhost", httpPort))
       .setMaxRetryTimeoutMillis(Integer.MAX_VALUE)
       .setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
-      @Override
-      RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
-        return builder.setConnectTimeout(Integer.MAX_VALUE).setSocketTimeout(Integer.MAX_VALUE)
-      }
-    })
+        @Override
+        RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
+          return builder.setConnectTimeout(Integer.MAX_VALUE).setSocketTimeout(Integer.MAX_VALUE)
+        }
+      })
       .build()
 
   }

+ 5 - 5
dd-java-agent/instrumentation/elasticsearch/rest-6.4/src/latestDepTest/groovy/Elasticsearch6RestClientTest.groovy

@@ -54,11 +54,11 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
     client = RestClient.builder(new HttpHost("localhost", httpPort))
       .setMaxRetryTimeoutMillis(Integer.MAX_VALUE)
       .setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
-      @Override
-      RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
-        return builder.setConnectTimeout(Integer.MAX_VALUE).setSocketTimeout(Integer.MAX_VALUE)
-      }
-    })
+        @Override
+        RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
+          return builder.setConnectTimeout(Integer.MAX_VALUE).setSocketTimeout(Integer.MAX_VALUE)
+        }
+      })
       .build()
 
   }

+ 5 - 5
dd-java-agent/instrumentation/elasticsearch/rest-6.4/src/test/groovy/Elasticsearch6RestClientTest.groovy

@@ -51,11 +51,11 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
     client = RestClient.builder(new HttpHost("localhost", httpPort))
       .setMaxRetryTimeoutMillis(Integer.MAX_VALUE)
       .setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
-      @Override
-      RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
-        return builder.setConnectTimeout(Integer.MAX_VALUE).setSocketTimeout(Integer.MAX_VALUE)
-      }
-    })
+        @Override
+        RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
+          return builder.setConnectTimeout(Integer.MAX_VALUE).setSocketTimeout(Integer.MAX_VALUE)
+        }
+      })
       .build()
 
   }

+ 1 - 1
dd-java-agent/instrumentation/elasticsearch/transport-2/transport-2.gradle

@@ -38,7 +38,7 @@ dependencies {
   testCompile group: 'net.java.dev.jna', name: 'jna', version: '4.5.1'
   testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
   testCompile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
-  
+
   testCompile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-smile', version: '2.9.9'
   // ^ is needed because we are using a newer version of jackson that isn't compatible without this.
 

+ 1 - 1
dd-java-agent/instrumentation/google-http-client/google-http-client.gradle

@@ -2,7 +2,7 @@ muzzle {
   pass {
     group = "com.google.http-client"
     module = "google-http-client"
-    
+
     // 1.19.0 is the first release.  The versions before are betas and RCs
     versions = "[1.19.0,)"
   }

+ 2 - 2
dd-java-agent/instrumentation/hystrix-1.4/hystrix-1.4.gradle

@@ -18,13 +18,13 @@ testSets {
 
 dependencies {
   compile project(':dd-java-agent:instrumentation:rxjava-1')
-  
+
   compileOnly group: 'com.netflix.hystrix', name: 'hystrix-core', version: '1.4.0'
   compileOnly group: 'io.reactivex', name: 'rxjava', version: '1.0.7'
 
   testCompile project(':dd-java-agent:instrumentation:java-concurrent')
   testCompile project(':dd-java-agent:instrumentation:trace-annotation')
-  
+
   testCompile group: 'io.reactivex', name: 'rxjava', version: '1.0.7'
   testCompile group: 'com.netflix.hystrix', name: 'hystrix-core', version: '1.4.0'
 

+ 2 - 2
dd-java-agent/instrumentation/instrumentation.gradle

@@ -16,7 +16,7 @@ plugins {
 apply from: "${rootDir}/gradle/java.gradle"
 
 Project instr_project = project
-subprojects {Project subProj ->
+subprojects { Project subProj ->
   apply plugin: "net.bytebuddy.byte-buddy"
   apply plugin: 'muzzle'
 
@@ -48,7 +48,7 @@ subprojects {Project subProj ->
       compile project(':dd-trace-api')
       compile project(':dd-java-agent:agent-tooling')
       compile deps.bytebuddy
-      if(jdkCompile) {
+      if (jdkCompile) {
         "$jdkCompile" project(':dd-trace-api')
         "$jdkCompile" project(':dd-java-agent:agent-tooling')
         "$jdkCompile" deps.bytebuddy

+ 6 - 6
dd-java-agent/instrumentation/java-concurrent/kotlin-testing/src/test/kotlin/KotlinCoroutineTests.kt

@@ -14,7 +14,7 @@ class KotlinCoroutineTests(private val dispatcher: CoroutineDispatcher) {
   @Trace
   fun tracedAcrossChannels(): Int = runTest {
     val producer = produce {
-      repeat(3){
+      repeat(3) {
         tracedChild("produce_$it")
         send(it)
       }
@@ -94,7 +94,7 @@ class KotlinCoroutineTests(private val dispatcher: CoroutineDispatcher) {
     5
   }
 
-   /**
+  /**
    * @return Number of expected spans in the trace
    */
   @Trace
@@ -123,17 +123,17 @@ class KotlinCoroutineTests(private val dispatcher: CoroutineDispatcher) {
       }
     }
 
-   4
+    4
   }
 
   @Trace
-  fun tracedChild(opName: String){
+  fun tracedChild(opName: String) {
     activeSpan().setSpanName(opName)
   }
 
-  private fun <T> runTest(asyncPropagation: Boolean = true, block: suspend CoroutineScope.()->T ): T {
+  private fun <T> runTest(asyncPropagation: Boolean = true, block: suspend CoroutineScope.() -> T): T {
     activeScope().setAsyncPropagation(asyncPropagation)
-    return runBlocking(dispatcher,block = block)
+    return runBlocking(dispatcher, block = block)
   }
 }
 

+ 1 - 1
dd-java-agent/instrumentation/jax-rs-client-2.0/src/test/groovy/JaxRsClientAsyncTest.groovy

@@ -24,7 +24,7 @@ abstract class JaxRsClientAsyncTest extends HttpClientTest<JaxRsClientDecorator>
     AsyncInvoker request = builder.async()
 
     def body = BODY_METHODS.contains(method) ? Entity.text("") : null
-    Response response = request.method(method, (Entity) body, new InvocationCallback<Response>(){
+    Response response = request.method(method, (Entity) body, new InvocationCallback<Response>() {
       @Override
       void completed(Response s) {
         callback?.call()

+ 1 - 1
dd-java-agent/instrumentation/jdbc/jdbc.gradle

@@ -19,7 +19,7 @@ dependencies {
   testCompile group: 'org.apache.tomcat', name: 'tomcat-juli', version: '7.0.19'
   testCompile group: 'com.zaxxer', name: 'HikariCP', version: '2.4.0'
   testCompile group: 'com.mchange', name: 'c3p0', version: '0.9.5'
-  
+
   latestDepTestCompile group: 'com.h2database', name: 'h2', version: '+'
   latestDepTestCompile group: 'org.apache.derby', name: 'derby', version: '10.14.+'
   latestDepTestCompile group: 'org.hsqldb', name: 'hsqldb', version: '+'

+ 2 - 2
dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingIterable.java

@@ -20,11 +20,11 @@ public class TracingIterable implements Iterable<ConsumerRecord> {
 
   @Override
   public Iterator<ConsumerRecord> iterator() {
-    Iterator<ConsumerRecord> it;
+    final Iterator<ConsumerRecord> it;
     // We should only return one iterator with tracing.
     // However, this is not thread-safe, but usually the first (hopefully only) traversal of
     // ConsumerRecords is performed in the same thread that called poll()
-    if (this.firstIterator) {
+    if (firstIterator) {
       it = new TracingIterator(delegate.iterator(), operationName, decorator);
       firstIterator = false;
     } else {

+ 1 - 1
dd-java-agent/instrumentation/kafka-clients-0.11/src/test/groovy/KafkaClientTest.groovy

@@ -131,7 +131,7 @@ class KafkaClientTest extends AgentTestRunner {
     def kafkaPartition = 0
     def consumerProperties = KafkaTestUtils.consumerProps("sender", "false", embeddedKafka)
     consumerProperties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest")
-    def consumer = new KafkaConsumer<String,String>(consumerProperties)
+    def consumer = new KafkaConsumer<String, String>(consumerProperties)
 
     def senderProps = KafkaTestUtils.senderProps(embeddedKafka.getBrokersAsString())
     def producer = new KafkaProducer(senderProps)

+ 1 - 1
dd-java-agent/instrumentation/mongo/driver-3.1/src/test/groovy/MongoClientTest.groovy

@@ -26,7 +26,7 @@ class MongoClientTest extends MongoBaseTest {
   def setup() throws Exception {
     client = new MongoClient(new ServerAddress("localhost", port),
       MongoClientOptions.builder()
-      .description("some-description")
+        .description("some-description")
         .build())
   }
 

+ 1 - 1
dd-java-agent/instrumentation/mongo/driver-async-3.3/src/test/groovy/MongoAsyncClientTest.groovy

@@ -104,7 +104,7 @@ class MongoAsyncClientTest extends MongoBaseTest {
     assertTraces(1) {
       trace(0, 1) {
         mongoSpan(it, 0) {
-          assert it.replaceAll(" ", "")  == "{\"count\":\"$collectionName\",\"query\":{}}" ||
+          assert it.replaceAll(" ", "") == "{\"count\":\"$collectionName\",\"query\":{}}" ||
             it == "{\"count\": \"$collectionName\", \"query\": {}, \"\$db\": \"?\", \"\$readPreference\": {\"mode\": \"?\"}}"
           true
         }

+ 14 - 11
dd-java-agent/instrumentation/spring-webflux-5/src/main/java8/datadog/trace/instrumentation/springwebflux/client/DefaultWebClientAdvice.java

@@ -10,18 +10,21 @@ public class DefaultWebClientAdvice {
 
   @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
   public static void methodExit(
-    @Advice.Thrown final Throwable throwable,
-    @Advice.This final ExchangeFunction exchangeFunction,
-    @Advice.Argument(0) final ClientRequest clientRequest,
-    @Advice.Return(readOnly = false) Mono<ClientResponse> mono) {
+      @Advice.Thrown final Throwable throwable,
+      @Advice.This final ExchangeFunction exchangeFunction,
+      @Advice.Argument(0) final ClientRequest clientRequest,
+      @Advice.Return(readOnly = false) Mono<ClientResponse> mono) {
     if (throwable == null
-      && mono != null
-      // The response of the org.springframework.web.reactive.function.client.ExchangeFunction.exchange method is
-      // replaced by a decorator that in turn also calls the
-      // org.springframework.web.reactive.function.client.ExchangeFunction.exchange method. If the original return value
-      // is already decorated (we detect this if the "x-datadog-trace-id" is added), the result is not decorated again
-      // to avoid StackOverflowErrors.
-      && !clientRequest.headers().keySet().contains("x-datadog-trace-id")) {
+        && mono != null
+        // The response of the
+        // org.springframework.web.reactive.function.client.ExchangeFunction.exchange method is
+        // replaced by a decorator that in turn also calls the
+        // org.springframework.web.reactive.function.client.ExchangeFunction.exchange method. If the
+        // original return value
+        // is already decorated (we detect this if the "x-datadog-trace-id" is added), the result is
+        // not decorated again
+        // to avoid StackOverflowErrors.
+        && !clientRequest.headers().keySet().contains("x-datadog-trace-id")) {
       mono = new TracingClientResponseMono(clientRequest, exchangeFunction);
     }
   }

+ 15 - 15
dd-java-agent/instrumentation/spring-webflux-5/src/main/java8/datadog/trace/instrumentation/springwebflux/client/TracingClientResponseSubscriber.java

@@ -49,22 +49,22 @@ public class TracingClientResponseSubscriber implements CoreSubscriber<ClientRes
       DECORATE.onRequest(span, clientRequest);
 
       subscriber.onSubscribe(
-        new Subscription() {
-          @Override
-          public void request(final long n) {
-            try (final AgentScope scope = activateSpan(span, false)) {
-              subscription.request(n);
+          new Subscription() {
+            @Override
+            public void request(final long n) {
+              try (final AgentScope scope = activateSpan(span, false)) {
+                subscription.request(n);
+              }
             }
-          }
-
-          @Override
-          public void cancel() {
-            DECORATE.onCancel(span);
-            DECORATE.beforeFinish(span);
-            subscription.cancel();
-            span.finish();
-          }
-        });
+
+            @Override
+            public void cancel() {
+              DECORATE.onCancel(span);
+              DECORATE.beforeFinish(span);
+              subscription.cancel();
+              span.finish();
+            }
+          });
     }
   }
 

+ 1 - 1
dd-java-agent/instrumentation/spring-webflux-5/src/test/groovy/dd/trace/instrumentation/springwebflux/client/SpringWebfluxHttpClientTest.groovy

@@ -32,7 +32,7 @@ class SpringWebfluxHttpClientTest extends HttpClientTest<SpringWebfluxHttpClient
       }
       .block()
 
-    if(hasParent) {
+    if (hasParent) {
       blockUntilChildSpansFinished(callback ? 3 : 2)
     }
     response.statusCode().value()

+ 0 - 1
dd-java-agent/instrumentation/tomcat-classloading/tomcat-classloading.gradle

@@ -1,4 +1,3 @@
-
 muzzle {
   pass {
     group = "org.apache.tomcat"

+ 1 - 1
dd-smoke-tests/dd-smoke-tests.gradle

@@ -10,7 +10,7 @@ dependencies {
 subprojects { subProject ->
   subProject.tasks.withType(Test).configureEach {
     dependsOn project(':dd-java-agent').shadowJar
-    
+
     // Tests depend on this to know where to run things and what agent jar to use
     jvmArgs "-Ddatadog.smoketest.builddir=${buildDir}"
     jvmArgs "-Ddatadog.smoketest.agent.shadowJar.path=${project(':dd-java-agent').tasks.shadowJar.archivePath}"

+ 2 - 2
dd-smoke-tests/java9-modules/java9-modules.gradle

@@ -20,7 +20,7 @@ jar {
 // it's special cased here instead of putting a generic version matcher in java.gradle
 if (JavaVersion.VERSION_1_9.compareTo(JavaVersion.current()) > 0) {
   def targetJavaHome
-  
+
   // Find a compatible version in the cache
   ext.javaExecutableVersionCache.find { key, value ->
     if (JavaVersion.VERSION_1_9.compareTo(value) <= 0) {
@@ -67,7 +67,7 @@ tasks.withType(Test).each {
 
   it.doFirst {
     delete generatedImageDir
-    
+
     // Run the jlink command to create the image
     exec {
       commandLine jlinkExecutable, '--no-man-pages', '--no-header-files',

+ 1 - 1
dd-smoke-tests/springboot/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java

@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 @SpringBootApplication
 public class SpringbootApplication {
 
-  public static void main(String[] args) {
+  public static void main(final String[] args) {
     SpringApplication.run(SpringbootApplication.class, args);
   }
 }

+ 1 - 1
gradle/java.gradle

@@ -39,7 +39,7 @@ if (project.hasProperty('minJavaVersionForTests') && project.getProperty('minJav
     "main_${name}CompileOnly" "org.projectlombok:lombok:${project.lombok.version}" transitive false
     "main_${name}AnnotationProcessor" "org.projectlombok:lombok:${project.lombok.version}" transitive false
   }
-  
+
   jar {
     from sourceSets."main_$name".output
   }