diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/build.gradle b/dd-java-agent/instrumentation/kotlin-coroutines/build.gradle index c13e8fab1f3..66935b361c3 100644 --- a/dd-java-agent/instrumentation/kotlin-coroutines/build.gradle +++ b/dd-java-agent/instrumentation/kotlin-coroutines/build.gradle @@ -2,13 +2,42 @@ plugins { id 'java-test-fixtures' } +muzzle { + pass { + group = 'org.jetbrains.kotlin' + module = 'kotlin-stdlib' + versions = "[1.3.0,)" + extraDependency "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0" + } + pass { + group = 'org.jetbrains.kotlinx' + module = 'kotlinx-coroutines-core' + versions = "[1.3.0,)" + } + pass { + group = 'org.jetbrains.kotlinx' + module = 'kotlinx-coroutines-core-jvm' + versions = "[1.5.0,)" + } +} + apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/gradle/test-with-kotlin.gradle" +addTestSuite('latestDepTest') + tasks.named("compileTestFixturesGroovy").configure { classpath += files(compileTestFixturesKotlin.destinationDirectory) } +tasks.named("compileTestGroovy").configure { + classpath += files(compileTestKotlin.destinationDirectory) +} + +tasks.named("compileLatestDepTestGroovy").configure { + classpath += files(compileLatestDepTestKotlin.destinationDirectory) +} + dependencies { api project(':dd-java-agent:instrumentation:java-concurrent') compileOnly libs.kotlin @@ -20,4 +49,12 @@ dependencies { testFixturesApi project(':dd-java-agent:instrumentation:trace-annotation') testFixturesApi project(':dd-java-agent:testing') testFixturesApi 'com.github.spotbugs:spotbugs-annotations:4.2.0' + + testImplementation libs.kotlin + testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0" + testImplementation testFixtures(project(':dd-java-agent:instrumentation:kotlin-coroutines')) + + latestDepTestImplementation libs.kotlin + latestDepTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.+" + latestDepTestImplementation testFixtures(project(':dd-java-agent:instrumentation:kotlin-coroutines')) } diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/build.gradle b/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/build.gradle deleted file mode 100644 index 6a070d199d4..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/build.gradle +++ /dev/null @@ -1,40 +0,0 @@ -plugins { - id 'java-test-fixtures' -} - -muzzle { - pass { - group = 'org.jetbrains.kotlin' - module = 'kotlin-stdlib' - versions = "[1.3.72,)" - extraDependency "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0" - } - pass { - group = 'org.jetbrains.kotlinx' - module = 'kotlinx-coroutines-core' - versions = "[1.3.0,1.3.8)" // for 1.3.9 - 1.4.3 muzzle fails to choose the variant - extraDependency "org.jetbrains.kotlin:kotlin-stdlib:1.6.21" - } -} - -apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/test-with-kotlin.gradle" - -addTestSuiteForDir('latestDepTest', 'test') - -tasks.named("compileLatestDepTestGroovy").configure { - classpath += files(compileLatestDepTestKotlin.destinationDirectory) -} - -dependencies { - def coroutinesVersion = '1.3.0' - implementation project(':dd-java-agent:instrumentation:kotlin-coroutines') - compileOnly libs.kotlin - compileOnly "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" - - testImplementation libs.kotlin - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" - testImplementation testFixtures(project(':dd-java-agent:instrumentation:kotlin-coroutines')) - - latestDepTestImplementation group: 'org.jetbrains.kotlinx', name: "kotlinx-coroutines-core", version: '1.4.+' -} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/gradle.lockfile b/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/gradle.lockfile deleted file mode 100644 index bad940aa4f9..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/gradle.lockfile +++ /dev/null @@ -1,178 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.beust:jcommander:1.78=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.3=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.github.jnr:jffi:1.3.13=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.17=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.16=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.19=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.22=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs -com.github.spotbugs:spotbugs:4.7.3=spotbugs -com.github.stefanbirkner:system-rules:1.19.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.google.auto.service:auto-service-annotations:1.0-rc7=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileOnlyDependenciesMetadata,testAnnotationProcessor,testCompileClasspath,testCompileOnlyDependenciesMetadata -com.google.auto.service:auto-service:1.0-rc7=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:0.10=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.errorprone:error_prone_annotations:2.2.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.google.guava:guava:27.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:1.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.thoughtworks.qdox:qdox:1.12.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -commons-codec:commons-codec:1.15=spotbugs -commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -de.thetaphi:forbiddenapis:3.8=compileClasspath,compileOnlyDependenciesMetadata -info.picocli:picocli:4.6.3=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:13.0.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs -jline:jline:2.14.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -junit:junit-dep:4.11=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.15.11=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.15.11=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -net.java.dev.jna:jna:5.8.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.jcip:jcip-annotations:1.0=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.sf.saxon:Saxon-HE:11.4=spotbugs -org.apache.ant:ant-antlr:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.ant:ant-antlr:1.9.15=codenarc -org.apache.ant:ant-junit:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.ant:ant-junit:1.9.15=codenarc -org.apache.ant:ant-launcher:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.ant:ant:1.10.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.apache.bcel:bcel:6.5.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs -org.apache.commons:commons-text:1.10.0=spotbugs -org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs -org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=spotbugs -org.apache.httpcomponents.core5:httpcore5:5.1.3=spotbugs -org.apache.logging.log4j:log4j-api:2.19.0=spotbugs -org.apache.logging.log4j:log4j-core:2.19.0=spotbugs -org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata -org.checkerframework:checker-qual:2.5.2=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -org.codehaus.groovy:groovy-all:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-ant:2.5.14=codenarc -org.codehaus.groovy:groovy-ant:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-astbuilder:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-cli-picocli:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-console:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-datetime:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-docgenerator:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-groovydoc:2.5.14=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-groovysh:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-jmx:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-json:2.5.14=codenarc -org.codehaus.groovy:groovy-json:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-jsr223:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-macro:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-nio:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-servlet:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-sql:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-swing:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:2.5.14=codenarc -org.codehaus.groovy:groovy-templates:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-test-junit5:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-test:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-testng:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-xml:2.5.14=codenarc -org.codehaus.groovy:groovy-xml:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy:2.5.14=codenarc -org.codehaus.groovy:groovy:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.17=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -org.codenarc:CodeNarc:2.2.0=codenarc -org.dom4j:dom4j:2.1.3=spotbugs -org.eclipse.jetty:jetty-http:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.eclipse.jetty:jetty-io:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.eclipse.jetty:jetty-server:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.eclipse.jetty:jetty-util:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.gmetrics:GMetrics:1.1=codenarc -org.hamcrest:hamcrest-core:1.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.hamcrest:hamcrest:2.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jctools:jctools-core:3.3.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.21=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.6.21=kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-reflect:1.6.21=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-script-runtime:1.6.21=kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-scripting-common:1.6.21=kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.6.21=kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.6.21=kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-jvm:1.6.21=kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlinx:atomicfu-common:0.15.1=latestDepTestImplementationDependenciesMetadata -org.jetbrains.kotlinx:atomicfu:0.15.1=latestDepTestImplementationDependenciesMetadata -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath -org.jetbrains:annotations:13.0=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.9.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.9.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.9.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit:junit-bom:5.9.1=spotbugs -org.junit:junit-bom:5.9.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.opentest4j:opentest4j:1.2.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.4=spotbugs -org.ow2.asm:asm-commons:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath -org.ow2.asm:asm-commons:9.4=spotbugs -org.ow2.asm:asm-commons:9.8=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath -org.ow2.asm:asm-tree:9.4=spotbugs -org.ow2.asm:asm-tree:9.8=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.4=spotbugs -org.ow2.asm:asm:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath -org.ow2.asm:asm:9.4=spotbugs -org.ow2.asm:asm:9.8=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata -org.slf4j:slf4j-api:1.7.32=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.0=spotbugs,spotbugsSlf4j -org.slf4j:slf4j-simple:2.0.0=spotbugsSlf4j -org.spockframework:spock-core:2.3-groovy-3.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.spockframework:spock-junit4:2.3-groovy-3.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.testng:testng:7.5=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.webjars:jquery:3.5.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.xmlresolver:xmlresolver:4.4.3=spotbugs -org.yaml:snakeyaml:2.4=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -xml-apis:xml-apis:1.4.01=spotbugs -empty=apiDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,latestDepTestApiDependenciesMetadata,latestDepTestIntransitiveDependenciesMetadata,latestDepTestKotlinScriptDef,latestDepTestKotlinScriptDefExtensions,latestDepTestRuntimeOnlyDependenciesMetadata,runtimeOnlyDependenciesMetadata,spotbugsPlugins,testApiDependenciesMetadata,testFixturesAnnotationProcessor,testFixturesCompileOnlyDependenciesMetadata,testFixturesIntransitiveDependenciesMetadata,testFixturesKotlinScriptDef,testFixturesKotlinScriptDefExtensions,testFixturesRuntimeOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntimeOnlyDependenciesMetadata diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutines13Instrumentation.java b/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutines13Instrumentation.java deleted file mode 100644 index 6e07f8fe686..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutines13Instrumentation.java +++ /dev/null @@ -1,63 +0,0 @@ -package datadog.trace.instrumentation.kotlin.coroutines; - -import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.instrumentation.kotlin.coroutines.CoroutineContextHelper.getScopeStateContext; -import static datadog.trace.instrumentation.kotlin.coroutines.CoroutineContextHelper.initializeScopeStateContextIfActive; -import static net.bytebuddy.matcher.ElementMatchers.isConstructor; -import static net.bytebuddy.matcher.ElementMatchers.isDeclaredBy; -import static net.bytebuddy.matcher.ElementMatchers.takesArgument; -import static net.bytebuddy.matcher.ElementMatchers.takesArguments; - -import com.google.auto.service.AutoService; -import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.instrumentation.kotlin.coroutines.ScopeStateCoroutineContext.ScopeStateCoroutineContextItem; -import kotlin.coroutines.CoroutineContext; -import kotlinx.coroutines.AbstractCoroutine; -import kotlinx.coroutines.Job; -import net.bytebuddy.asm.Advice; - -@AutoService(InstrumenterModule.class) -public class KotlinCoroutines13Instrumentation extends AbstractCoroutinesInstrumentation { - - @Override - public void methodAdvice(MethodTransformer transformer) { - super.methodAdvice(transformer); - transformer.applyAdvice( - isConstructor() - .and(isDeclaredBy(named(ABSTRACT_COROUTINE_CLASS_NAME))) - .and(takesArguments(2)) - .and(takesArgument(0, named(COROUTINE_CONTEXT_CLASS_NAME))) - .and(takesArgument(1, named("boolean"))), - KotlinCoroutines13Instrumentation.class.getName() + "$AbstractCoroutineConstructorAdvice"); - } - - /** - * Guarantees every coroutine created has an instance of ScopeStateCoroutineContext - * - * @see ScopeStateCoroutineContext - * @see AbstractCoroutine#AbstractCoroutine(CoroutineContext, boolean) - */ - public static class AbstractCoroutineConstructorAdvice { - @Advice.OnMethodEnter - public static void constructorInvocation( - @Advice.Argument(value = 0, readOnly = false) CoroutineContext parentContext) { - final ScopeStateCoroutineContext scopeStackContext = getScopeStateContext(parentContext); - if (scopeStackContext == null) { - parentContext = - parentContext.plus( - new ScopeStateCoroutineContext( - InstrumentationContext.get(Job.class, ScopeStateCoroutineContextItem.class))); - } - } - - @Advice.OnMethodExit - public static void constructorInvocationOnMethodExit( - @Advice.This final AbstractCoroutine coroutine, - @Advice.Argument(value = 1) final boolean active) { - // if this is not a lazy coroutine, inherit parent span from - // the coroutine constructor call site - initializeScopeStateContextIfActive(coroutine, active); - } - } -} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/build.gradle b/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/build.gradle deleted file mode 100644 index 8617ba19350..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/build.gradle +++ /dev/null @@ -1,40 +0,0 @@ -plugins { - id 'java-test-fixtures' -} - -muzzle { - pass { - group = 'org.jetbrains.kotlin' - module = 'kotlin-stdlib' - versions = "[1.6.21,)" - extraDependency "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0" - } - pass { - group = 'org.jetbrains.kotlinx' - module = 'kotlinx-coroutines-core-jvm' - versions = "[1.5.0,)" - extraDependency "org.jetbrains.kotlin:kotlin-stdlib:1.6.21" - } -} - -apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/test-with-kotlin.gradle" - -addTestSuiteForDir('latestDepTest', 'test') - -tasks.named("compileLatestDepTestGroovy").configure { - classpath += files(compileLatestDepTestKotlin.destinationDirectory) -} - -dependencies { - def coroutinesVersion = '1.5.0' - implementation project(':dd-java-agent:instrumentation:kotlin-coroutines') - compileOnly libs.kotlin - compileOnly "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$coroutinesVersion" - - testImplementation libs.kotlin - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$coroutinesVersion" - testImplementation testFixtures(project(':dd-java-agent:instrumentation:kotlin-coroutines')) - - latestDepTestImplementation group: 'org.jetbrains.kotlinx', name: "kotlinx-coroutines-core", version: '1.6.+' -} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/gradle.lockfile b/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/gradle.lockfile deleted file mode 100644 index 9b9e543b30e..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/gradle.lockfile +++ /dev/null @@ -1,181 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.beust:jcommander:1.78=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.3=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.github.jnr:jffi:1.3.13=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.17=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.16=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.19=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.22=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs -com.github.spotbugs:spotbugs:4.7.3=spotbugs -com.github.stefanbirkner:system-rules:1.19.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.google.auto.service:auto-service-annotations:1.0-rc7=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileOnlyDependenciesMetadata,testAnnotationProcessor,testCompileClasspath,testCompileOnlyDependenciesMetadata -com.google.auto.service:auto-service:1.0-rc7=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:0.10=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.errorprone:error_prone_annotations:2.2.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.google.guava:guava:27.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:1.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.thoughtworks.qdox:qdox:1.12.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -commons-codec:commons-codec:1.15=spotbugs -commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -de.thetaphi:forbiddenapis:3.8=compileClasspath,compileOnlyDependenciesMetadata -info.picocli:picocli:4.6.3=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:13.0.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs -jline:jline:2.14.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -junit:junit-dep:4.11=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.15.11=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.15.11=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -net.java.dev.jna:jna:5.8.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.jcip:jcip-annotations:1.0=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.sf.saxon:Saxon-HE:11.4=spotbugs -org.apache.ant:ant-antlr:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.ant:ant-antlr:1.9.15=codenarc -org.apache.ant:ant-junit:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.ant:ant-junit:1.9.15=codenarc -org.apache.ant:ant-launcher:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.ant:ant:1.10.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.apache.bcel:bcel:6.5.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs -org.apache.commons:commons-text:1.10.0=spotbugs -org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs -org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=spotbugs -org.apache.httpcomponents.core5:httpcore5:5.1.3=spotbugs -org.apache.logging.log4j:log4j-api:2.19.0=spotbugs -org.apache.logging.log4j:log4j-core:2.19.0=spotbugs -org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata -org.checkerframework:checker-qual:2.5.2=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -org.codehaus.groovy:groovy-all:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-ant:2.5.14=codenarc -org.codehaus.groovy:groovy-ant:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-astbuilder:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-cli-picocli:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-console:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-datetime:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-docgenerator:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-groovydoc:2.5.14=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-groovysh:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-jmx:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-json:2.5.14=codenarc -org.codehaus.groovy:groovy-json:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-jsr223:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-macro:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-nio:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-servlet:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-sql:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-swing:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:2.5.14=codenarc -org.codehaus.groovy:groovy-templates:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-test-junit5:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-test:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-testng:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy-xml:2.5.14=codenarc -org.codehaus.groovy:groovy-xml:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.groovy:groovy:2.5.14=codenarc -org.codehaus.groovy:groovy:3.0.17=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.17=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -org.codenarc:CodeNarc:2.2.0=codenarc -org.dom4j:dom4j:2.1.3=spotbugs -org.eclipse.jetty:jetty-http:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.eclipse.jetty:jetty-io:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.eclipse.jetty:jetty-server:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.eclipse.jetty:jetty-util:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.gmetrics:GMetrics:1.1=codenarc -org.hamcrest:hamcrest-core:1.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.hamcrest:hamcrest:2.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jctools:jctools-core:3.3.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-daemon-embeddable:1.6.21=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.6.21=kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-reflect:1.6.21=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-script-runtime:1.6.21=kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-scripting-common:1.6.21=kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.6.21=kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.6.21=kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-jvm:1.6.21=kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.0=compileClasspath,compileOnlyDependenciesMetadata -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.0=compileClasspath,compileOnlyDependenciesMetadata -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlinx:atomicfu:0.17.3=latestDepTestImplementationDependenciesMetadata -org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestImplementationDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0=testRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath -org.jetbrains:annotations:13.0=compileClasspath,compileOnlyDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.9.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.9.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.9.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit:junit-bom:5.9.1=spotbugs -org.junit:junit-bom:5.9.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.opentest4j:opentest4j:1.2.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.4=spotbugs -org.ow2.asm:asm-commons:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath -org.ow2.asm:asm-commons:9.4=spotbugs -org.ow2.asm:asm-commons:9.8=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath -org.ow2.asm:asm-tree:9.4=spotbugs -org.ow2.asm:asm-tree:9.8=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.4=spotbugs -org.ow2.asm:asm:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath -org.ow2.asm:asm:9.4=spotbugs -org.ow2.asm:asm:9.8=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=compileClasspath,implementationDependenciesMetadata,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata -org.slf4j:slf4j-api:1.7.32=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.0=spotbugs,spotbugsSlf4j -org.slf4j:slf4j-simple:2.0.0=spotbugsSlf4j -org.spockframework:spock-core:2.3-groovy-3.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.spockframework:spock-junit4:2.3-groovy-3.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.testng:testng:7.5=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.webjars:jquery:3.5.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.xmlresolver:xmlresolver:4.4.3=spotbugs -org.yaml:snakeyaml:2.4=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -xml-apis:xml-apis:1.4.01=spotbugs -empty=apiDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,latestDepTestApiDependenciesMetadata,latestDepTestIntransitiveDependenciesMetadata,latestDepTestKotlinScriptDef,latestDepTestKotlinScriptDefExtensions,latestDepTestRuntimeOnlyDependenciesMetadata,runtimeOnlyDependenciesMetadata,spotbugsPlugins,testApiDependenciesMetadata,testFixturesAnnotationProcessor,testFixturesCompileOnlyDependenciesMetadata,testFixturesIntransitiveDependenciesMetadata,testFixturesKotlinScriptDef,testFixturesKotlinScriptDefExtensions,testFixturesRuntimeOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntimeOnlyDependenciesMetadata diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutines15Instrumentation.java b/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutines15Instrumentation.java deleted file mode 100644 index f8f825103cf..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutines15Instrumentation.java +++ /dev/null @@ -1,63 +0,0 @@ -package datadog.trace.instrumentation.kotlin.coroutines; - -import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.instrumentation.kotlin.coroutines.CoroutineContextHelper.getScopeStateContext; -import static datadog.trace.instrumentation.kotlin.coroutines.CoroutineContextHelper.initializeScopeStateContextIfActive; -import static net.bytebuddy.matcher.ElementMatchers.isConstructor; -import static net.bytebuddy.matcher.ElementMatchers.isDeclaredBy; -import static net.bytebuddy.matcher.ElementMatchers.takesArgument; -import static net.bytebuddy.matcher.ElementMatchers.takesArguments; - -import com.google.auto.service.AutoService; -import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.instrumentation.kotlin.coroutines.ScopeStateCoroutineContext.ScopeStateCoroutineContextItem; -import kotlin.coroutines.CoroutineContext; -import kotlinx.coroutines.AbstractCoroutine; -import kotlinx.coroutines.Job; -import net.bytebuddy.asm.Advice; - -@AutoService(InstrumenterModule.class) -public class KotlinCoroutines15Instrumentation extends AbstractCoroutinesInstrumentation { - - @Override - public void methodAdvice(MethodTransformer transformer) { - super.methodAdvice(transformer); - transformer.applyAdvice( - isConstructor() - .and(isDeclaredBy(named(ABSTRACT_COROUTINE_CLASS_NAME))) - .and(takesArguments(3)) - .and(takesArgument(0, named(COROUTINE_CONTEXT_CLASS_NAME))) - .and(takesArgument(2, named("boolean"))), - KotlinCoroutines15Instrumentation.class.getName() + "$AbstractCoroutineConstructorAdvice"); - } - - /** - * Guarantees every coroutine created has an instance of ScopeStateCoroutineContext - * - * @see ScopeStateCoroutineContext - * @see AbstractCoroutine#AbstractCoroutine(CoroutineContext, boolean, boolean) - */ - public static class AbstractCoroutineConstructorAdvice { - @Advice.OnMethodEnter - public static void constructorInvocation( - @Advice.Argument(value = 0, readOnly = false) CoroutineContext parentContext) { - final ScopeStateCoroutineContext scopeStackContext = getScopeStateContext(parentContext); - if (scopeStackContext == null) { - parentContext = - parentContext.plus( - new ScopeStateCoroutineContext( - InstrumentationContext.get(Job.class, ScopeStateCoroutineContextItem.class))); - } - } - - @Advice.OnMethodExit - public static void constructorInvocationOnMethodExit( - @Advice.This final AbstractCoroutine coroutine, - @Advice.Argument(value = 2) final boolean active) { - // if this is not a lazy coroutine, inherit parent span from - // the coroutine constructor call site - initializeScopeStateContextIfActive(coroutine, active); - } - } -} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy b/dd-java-agent/instrumentation/kotlin-coroutines/src/latestDepTest/groovy/KotlinCoroutineInstrumentationTest.groovy similarity index 100% rename from dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy rename to dd-java-agent/instrumentation/kotlin-coroutines/src/latestDepTest/groovy/KotlinCoroutineInstrumentationTest.groovy diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/src/test/kotlin/KotlinCoroutineTests.kt b/dd-java-agent/instrumentation/kotlin-coroutines/src/latestDepTest/kotlin/KotlinCoroutineTests.kt similarity index 100% rename from dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.5/src/test/kotlin/KotlinCoroutineTests.kt rename to dd-java-agent/instrumentation/kotlin-coroutines/src/latestDepTest/kotlin/KotlinCoroutineTests.kt diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/AbstractCoroutinesInstrumentation.java b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/AbstractCoroutinesInstrumentation.java deleted file mode 100644 index 897e85079f7..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/AbstractCoroutinesInstrumentation.java +++ /dev/null @@ -1,119 +0,0 @@ -package datadog.trace.instrumentation.kotlin.coroutines; - -import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.extendsClass; -import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.instrumentation.kotlin.coroutines.CoroutineContextHelper.closeScopeStateContext; -import static datadog.trace.instrumentation.kotlin.coroutines.CoroutineContextHelper.initializeScopeStateContext; -import static net.bytebuddy.matcher.ElementMatchers.isMethod; -import static net.bytebuddy.matcher.ElementMatchers.isOverriddenFrom; -import static net.bytebuddy.matcher.ElementMatchers.returns; -import static net.bytebuddy.matcher.ElementMatchers.takesArguments; -import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; - -import datadog.trace.agent.tooling.Instrumenter; -import datadog.trace.agent.tooling.InstrumenterModule; -import java.util.Collections; -import java.util.Map; -import kotlinx.coroutines.AbstractCoroutine; -import net.bytebuddy.asm.Advice; -import net.bytebuddy.description.type.TypeDescription; -import net.bytebuddy.matcher.ElementMatcher; - -public abstract class AbstractCoroutinesInstrumentation extends InstrumenterModule.Tracing - implements Instrumenter.ForTypeHierarchy, - Instrumenter.WithTypeStructure, - Instrumenter.HasMethodAdvice { - - protected static final String ABSTRACT_COROUTINE_CLASS_NAME = - "kotlinx.coroutines.AbstractCoroutine"; - - protected static final String JOB_SUPPORT_CLASS_NAME = "kotlinx.coroutines.JobSupport"; - protected static final String COROUTINE_CONTEXT_CLASS_NAME = "kotlin.coroutines.CoroutineContext"; - - public AbstractCoroutinesInstrumentation() { - super("kotlin_coroutine.experimental"); - } - - @Override - protected final boolean defaultEnabled() { - return false; - } - - @Override - public String[] helperClassNames() { - return new String[] { - packageName + ".ScopeStateCoroutineContext", - packageName + ".ScopeStateCoroutineContext$ContextElementKey", - packageName + ".ScopeStateCoroutineContext$ScopeStateCoroutineContextItem", - packageName + ".CoroutineContextHelper", - }; - } - - @Override - public void methodAdvice(MethodTransformer transformer) { - transformer.applyAdvice( - isMethod().and(named("onStart")).and(takesNoArguments()).and(returns(void.class)), - AbstractCoroutinesInstrumentation.class.getName() + "$AbstractCoroutineOnStartAdvice"); - - transformer.applyAdvice( - isMethod() - .and(isOverriddenFrom(named(JOB_SUPPORT_CLASS_NAME))) - .and(named("onCompletionInternal")) - .and(takesArguments(1)) - .and(returns(void.class)), - AbstractCoroutinesInstrumentation.class.getName() - + "$JobSupportAfterCompletionInternalAdvice"); - } - - @Override - public String hierarchyMarkerType() { - return JOB_SUPPORT_CLASS_NAME; - } - - @Override - public ElementMatcher hierarchyMatcher() { - return extendsClass(named(hierarchyMarkerType())); - } - - @Override - public ElementMatcher structureMatcher() { - return extendsClass(named(ABSTRACT_COROUTINE_CLASS_NAME)); - } - - @Override - public Map contextStore() { - return Collections.singletonMap( - "kotlinx.coroutines.Job", - packageName + ".ScopeStateCoroutineContext$ScopeStateCoroutineContextItem"); - } - - /** - * If/when coroutine is started lazily, initializes ScopeStateCoroutineContext element on - * coroutine start - * - * @see ScopeStateCoroutineContext - * @see AbstractCoroutine#onStart() - */ - public static class AbstractCoroutineOnStartAdvice { - @Advice.OnMethodEnter - public static void onStartInvocation(@Advice.This final AbstractCoroutine coroutine) { - // try to inherit parent span from the coroutine start call site - initializeScopeStateContext(coroutine); - } - } - - /** - * Guarantees a ScopeStateCoroutineContext element is always closed when coroutine transitions - * into a terminal state. - * - * @see ScopeStateCoroutineContext - * @see AbstractCoroutine#onCompletionInternal(Object) - */ - public static class JobSupportAfterCompletionInternalAdvice { - @Advice.OnMethodEnter - public static void onCompletionInternal(@Advice.This final AbstractCoroutine coroutine) { - // close the scope if needed - closeScopeStateContext(coroutine); - } - } -} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineContextHelper.java b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineContextHelper.java deleted file mode 100644 index 764d0f157d0..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineContextHelper.java +++ /dev/null @@ -1,105 +0,0 @@ -package datadog.trace.instrumentation.kotlin.coroutines; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; -import kotlin.coroutines.CoroutineContext; -import kotlinx.coroutines.AbstractCoroutine; -import kotlinx.coroutines.ChildHandle; -import kotlinx.coroutines.Job; -import kotlinx.coroutines.JobNode; -import kotlinx.coroutines.JobSupport; -import org.jetbrains.annotations.Nullable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CoroutineContextHelper { - private static final Logger log = LoggerFactory.getLogger(CoroutineContextHelper.class); - - /* - IntelliJ shows a warning here for Job being out of bounds, but that's not true, the class compiles. - */ - @Nullable - @SuppressWarnings("unchecked") - public static Job getJob(final CoroutineContext context) { - return context.get((CoroutineContext.Key) Job.Key); - } - - @Nullable - public static ScopeStateCoroutineContext getScopeStateContext(final CoroutineContext context) { - return context.get(ScopeStateCoroutineContext.KEY); - } - - public static void initializeScopeStateContextIfActive( - final AbstractCoroutine coroutine, final boolean active) { - if (active) { - initializeScopeStateContext(coroutine); - } - } - - public static void initializeScopeStateContext(final AbstractCoroutine coroutine) { - final ScopeStateCoroutineContext scopeStackContext = - getScopeStateContext(coroutine.getContext()); - if (scopeStackContext != null) { - scopeStackContext.maybeInitialize(coroutine); - } - } - - public static void closeScopeStateContext(final AbstractCoroutine coroutine) { - final ScopeStateCoroutineContext scopeStackContext = - getScopeStateContext(coroutine.getContext()); - if (scopeStackContext != null) { - scopeStackContext.maybeCloseScopeAndCancelContinuation(coroutine, getParentJob(coroutine)); - } - } - - private static final MethodHandle PARENT_HANDLE_METHOD; - private static final MethodHandle PARENT_HANDLE_FIELD; - private static final MethodHandle JOB_FIELD; - - static { - MethodHandle parentHandleMethod = null; - MethodHandle parentHandleField = null; - MethodHandle jobField = null; - - MethodHandles.Lookup lookup = MethodHandles.publicLookup(); - try { - // Kotlin coroutines 1.5+ - parentHandleMethod = - lookup.findVirtual( - JobSupport.class, - "getParentHandle$kotlinx_coroutines_core", - MethodType.methodType(ChildHandle.class)); - jobField = lookup.findGetter(JobNode.class, "job", JobSupport.class); - } catch (Throwable ignore) { - try { - // Kotlin coroutines 1.3 - parentHandleField = lookup.findGetter(JobSupport.class, "parentHandle", ChildHandle.class); - jobField = lookup.findGetter(JobNode.class, "job", Job.class); - } catch (Throwable e) { - log.debug("Unable to access parent handle", e); - } - } - - PARENT_HANDLE_METHOD = parentHandleMethod; - PARENT_HANDLE_FIELD = parentHandleField; - JOB_FIELD = jobField; - } - - private static Job getParentJob(JobSupport coroutine) { - try { - Object parentHandle = null; - if (null != PARENT_HANDLE_METHOD) { - parentHandle = PARENT_HANDLE_METHOD.invoke(coroutine); - } else if (null != PARENT_HANDLE_FIELD) { - parentHandle = PARENT_HANDLE_FIELD.invoke(coroutine); - } - if (parentHandle instanceof JobNode) { - return (Job) JOB_FIELD.invoke((JobNode) parentHandle); - } - } catch (Throwable e) { - log.debug("Unable to extract parent job", e); - } - return null; - } -} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineContextInstrumentation.java b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineContextInstrumentation.java new file mode 100644 index 00000000000..6fd209caeaf --- /dev/null +++ b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineContextInstrumentation.java @@ -0,0 +1,37 @@ +package datadog.trace.instrumentation.kotlin.coroutines; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; + +import datadog.trace.agent.tooling.Instrumenter; +import kotlin.coroutines.CoroutineContext; +import net.bytebuddy.asm.Advice; + +/** Adds {@link DatadogThreadContextElement} to every coroutine context. */ +public class CoroutineContextInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + @Override + public String instrumentedType() { + return "kotlinx.coroutines.CoroutineContextKt"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("newCoroutineContext") + .and(takesArgument(0, named("kotlinx.coroutines.CoroutineScope"))) + .and(takesArgument(1, named("kotlin.coroutines.CoroutineContext"))), + this.getClass().getName() + "$ContextAdvice"); + } + + public static class ContextAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static void enter( + @Advice.Argument(value = 1, readOnly = false) CoroutineContext coroutineContext) { + if (coroutineContext != null) { + coroutineContext = DatadogThreadContextElement.addDatadogElement(coroutineContext); + } + } + } +} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineInstrumentation.java b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineInstrumentation.java new file mode 100644 index 00000000000..87dab50a525 --- /dev/null +++ b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/CoroutineInstrumentation.java @@ -0,0 +1,46 @@ +package datadog.trace.instrumentation.kotlin.coroutines; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.isConstructor; + +import datadog.trace.agent.tooling.Instrumenter; +import kotlinx.coroutines.AbstractCoroutine; +import net.bytebuddy.asm.Advice; + +/** + * Captures the Datadog context when non-lazy coroutines are constructed. Also cancels the captured + * Datadog context when any coroutine completes (regardless whether it is lazy or non-lazy). + */ +public class CoroutineInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + @Override + public String instrumentedType() { + return "kotlinx.coroutines.AbstractCoroutine"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + isConstructor(), CoroutineInstrumentation.class.getName() + "$ConstructorAdvice"); + transformer.applyAdvice( + named("onCompletionInternal"), + CoroutineInstrumentation.class.getName() + "$OnCompletionAdvice"); + } + + public static class ConstructorAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void afterConstruction(@Advice.This AbstractCoroutine coroutine) { + if (coroutine.isActive()) { + DatadogThreadContextElement.captureDatadogContext(coroutine); + } + } + } + + public static class OnCompletionAdvice { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void afterCompletion(@Advice.This AbstractCoroutine coroutine) { + DatadogThreadContextElement.cancelDatadogContext(coroutine); + } + } +} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/DatadogThreadContextElement.java b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/DatadogThreadContextElement.java new file mode 100644 index 00000000000..ed9a3efc4ff --- /dev/null +++ b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/DatadogThreadContextElement.java @@ -0,0 +1,94 @@ +package datadog.trace.instrumentation.kotlin.coroutines; + +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.ScopeState; +import kotlin.coroutines.CoroutineContext; +import kotlin.jvm.functions.Function2; +import kotlinx.coroutines.AbstractCoroutine; +import kotlinx.coroutines.ThreadContextElement; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** Manages the Datadog context for coroutines, switching contexts as coroutines switch threads. */ +public final class DatadogThreadContextElement implements ThreadContextElement { + private static final CoroutineContext.Key DATADOG_KEY = + new CoroutineContext.Key() {}; + + public static CoroutineContext addDatadogElement(CoroutineContext coroutineContext) { + if (coroutineContext.get(DATADOG_KEY) != null) { + return coroutineContext; // already added + } + return coroutineContext.plus(new DatadogThreadContextElement()); + } + + private ScopeState scopeState; + private AgentScope.Continuation continuation; + + @NotNull + @Override + public Key getKey() { + return DATADOG_KEY; + } + + public static void captureDatadogContext(@NotNull AbstractCoroutine coroutine) { + DatadogThreadContextElement datadogContext = coroutine.getContext().get(DATADOG_KEY); + if (datadogContext != null && datadogContext.scopeState == null) { + // copy scope stack to use for this coroutine + datadogContext.scopeState = AgentTracer.get().oldScopeState().copy(); + // stop enclosing trace from finishing early + datadogContext.continuation = AgentTracer.captureActiveSpan(); + } + } + + public static void cancelDatadogContext(@NotNull AbstractCoroutine coroutine) { + DatadogThreadContextElement datadogContext = coroutine.getContext().get(DATADOG_KEY); + if (datadogContext != null && datadogContext.continuation != null) { + // release enclosing trace now the coroutine has completed + datadogContext.continuation.cancel(); + } + } + + @Override + public ScopeState updateThreadContext(@NotNull CoroutineContext coroutineContext) { + ScopeState oldState = AgentTracer.get().oldScopeState(); + if (scopeState == null) { + // copy scope stack to use for this coroutine + scopeState = oldState.copy(); + // stop enclosing trace from finishing early + continuation = AgentTracer.captureActiveSpan(); + } + scopeState.activate(); // swap in the coroutine's scope stack + return oldState; + } + + @Override + public void restoreThreadContext( + @NotNull CoroutineContext coroutineContext, ScopeState oldState) { + oldState.activate(); // swap bock the original scope stack + } + + @NotNull + @Override + public CoroutineContext plus(@NotNull CoroutineContext coroutineContext) { + return CoroutineContext.DefaultImpls.plus(this, coroutineContext); + } + + @Override + public R fold( + R initial, @NotNull Function2 operation) { + return CoroutineContext.Element.DefaultImpls.fold(this, initial, operation); + } + + @Nullable + @Override + public E get(@NotNull Key key) { + return CoroutineContext.Element.DefaultImpls.get(this, key); + } + + @NotNull + @Override + public CoroutineContext minusKey(@NotNull Key key) { + return CoroutineContext.Element.DefaultImpls.minusKey(this, key); + } +} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutinesModule.java b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutinesModule.java new file mode 100644 index 00000000000..6de4186cac8 --- /dev/null +++ b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/KotlinCoroutinesModule.java @@ -0,0 +1,34 @@ +package datadog.trace.instrumentation.kotlin.coroutines; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import java.util.Arrays; +import java.util.List; + +@AutoService(InstrumenterModule.class) +public class KotlinCoroutinesModule extends InstrumenterModule.Tracing { + public KotlinCoroutinesModule() { + super("kotlin_coroutine.experimental"); + } + + @Override + protected final boolean defaultEnabled() { + return false; + } + + @Override + public String[] helperClassNames() { + return new String[] { + packageName + ".DatadogThreadContextElement", packageName + ".DatadogThreadContextElement$1" + }; + } + + @Override + public List typeInstrumentations() { + return Arrays.asList( + new CoroutineContextInstrumentation(), + new CoroutineInstrumentation(), + new LazyCoroutineInstrumentation()); + } +} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/LazyCoroutineInstrumentation.java b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/LazyCoroutineInstrumentation.java new file mode 100644 index 00000000000..26725997e68 --- /dev/null +++ b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/LazyCoroutineInstrumentation.java @@ -0,0 +1,32 @@ +package datadog.trace.instrumentation.kotlin.coroutines; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; + +import datadog.trace.agent.tooling.Instrumenter; +import kotlinx.coroutines.AbstractCoroutine; +import net.bytebuddy.asm.Advice; + +/** Captures the Datadog context when lazy coroutines start. */ +public class LazyCoroutineInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + @Override + public String instrumentedType() { + return "kotlinx.coroutines.LazyDeferredCoroutine"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + isMethod().and(named("onStart")), + LazyCoroutineInstrumentation.class.getName() + "$OnStartAdvice"); + } + + public static class OnStartAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static void onStart(@Advice.This AbstractCoroutine coroutine) { + DatadogThreadContextElement.captureDatadogContext(coroutine); + } + } +} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/ScopeStateCoroutineContext.java b/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/ScopeStateCoroutineContext.java deleted file mode 100644 index b08986f6c71..00000000000 --- a/dd-java-agent/instrumentation/kotlin-coroutines/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/ScopeStateCoroutineContext.java +++ /dev/null @@ -1,162 +0,0 @@ -package datadog.trace.instrumentation.kotlin.coroutines; - -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; - -import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; -import datadog.trace.bootstrap.instrumentation.api.AgentTracer; -import datadog.trace.bootstrap.instrumentation.api.ScopeState; -import kotlin.coroutines.CoroutineContext; -import kotlin.jvm.functions.Function2; -import kotlinx.coroutines.Job; -import kotlinx.coroutines.ThreadContextElement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class ScopeStateCoroutineContext implements ThreadContextElement { - - public static final Key KEY = new ContextElementKey(); - - private final ContextStore contextItemPerCoroutine; - - public ScopeStateCoroutineContext( - final ContextStore contextItemPerCoroutine) { - this.contextItemPerCoroutine = contextItemPerCoroutine; - } - - /** Get a context item instance for the coroutine and try to initialize it */ - public void maybeInitialize(final Job coroutine) { - contextItemPerCoroutine - .putIfAbsent(coroutine, ScopeStateCoroutineContextItem::new) - .maybeInitialize(); - } - - @Override - public void restoreThreadContext( - @NotNull final CoroutineContext coroutineContext, final ScopeState oldState) { - oldState.activate(); - } - - @Override - public ScopeState updateThreadContext(@NotNull final CoroutineContext coroutineContext) { - final ScopeState oldScopeState = AgentTracer.get().oldScopeState(); - - final Job coroutine = CoroutineContextHelper.getJob(coroutineContext); - final ScopeStateCoroutineContextItem contextItem = contextItemPerCoroutine.get(coroutine); - if (contextItem != null) { - contextItem.activate(); - } - - return oldScopeState; - } - - /** If there's a context item for the coroutine then try to close it */ - public void maybeCloseScopeAndCancelContinuation(final Job coroutine, final Job parent) { - final ScopeStateCoroutineContextItem contextItem = contextItemPerCoroutine.remove(coroutine); - if (contextItem != null) { - ScopeState currentThreadScopeState = null; - if (parent != null) { - final ScopeStateCoroutineContextItem parentItem = contextItemPerCoroutine.get(parent); - if (parentItem != null) { - currentThreadScopeState = parentItem.maybeCopyScopeState(); - } - } - if (currentThreadScopeState == null) { - currentThreadScopeState = AgentTracer.get().oldScopeState(); - } - - contextItem.maybeCloseScopeAndCancelContinuation(); - - currentThreadScopeState.activate(); - } - } - - @Nullable - @Override - public E get(@NotNull final Key key) { - return Element.DefaultImpls.get(this, key); - } - - @NotNull - @Override - public CoroutineContext minusKey(@NotNull final Key key) { - return Element.DefaultImpls.minusKey(this, key); - } - - @NotNull - @Override - public CoroutineContext plus(@NotNull final CoroutineContext coroutineContext) { - return CoroutineContext.DefaultImpls.plus(this, coroutineContext); - } - - @Override - public R fold( - R initial, @NotNull Function2 operation) { - return Element.DefaultImpls.fold(this, initial, operation); - } - - @NotNull - @Override - public Key getKey() { - return KEY; - } - - static class ContextElementKey implements Key {} - - public static class ScopeStateCoroutineContextItem { - private final ScopeState coroutineScopeState; - @Nullable private AgentScope.Continuation continuation; - @Nullable private AgentScope continuationScope; - private boolean isInitialized = false; - private volatile Thread activatedOn; - - public ScopeStateCoroutineContextItem() { - coroutineScopeState = AgentTracer.get().newScopeState(); - } - - public ScopeState maybeCopyScopeState() { - // take defensive copy of scope stack if on different thread - if (activatedOn != null && activatedOn != Thread.currentThread()) { - return coroutineScopeState.copy(); - } else { - return coroutineScopeState; - } - } - - public void activate() { - activatedOn = Thread.currentThread(); - coroutineScopeState.activate(); - - if (continuation != null && continuationScope == null) { - continuationScope = continuation.activate(); - } - } - - /** - * If there is an active scope at the time of invocation, and it is async propagated, then - * captures the scope's continuation - */ - public void maybeInitialize() { - if (!isInitialized) { - continuation = captureActiveSpan().hold(); - isInitialized = true; - } - } - - /** - * If the context item has a captured scope continuation and an active scope, then closes the - * scope and cancels the continuation. - */ - public void maybeCloseScopeAndCancelContinuation() { - // only temporary activation, will be replaced by another activate in caller - coroutineScopeState.activate(); - - if (continuationScope != null) { - continuationScope.close(); - } - if (continuation != null) { - continuation.cancel(); - } - } - } -} diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy b/dd-java-agent/instrumentation/kotlin-coroutines/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy similarity index 100% rename from dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy rename to dd-java-agent/instrumentation/kotlin-coroutines/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/src/test/kotlin/KotlinCoroutineTests.kt b/dd-java-agent/instrumentation/kotlin-coroutines/src/test/kotlin/KotlinCoroutineTests.kt similarity index 100% rename from dd-java-agent/instrumentation/kotlin-coroutines/coroutines-1.3/src/test/kotlin/KotlinCoroutineTests.kt rename to dd-java-agent/instrumentation/kotlin-coroutines/src/test/kotlin/KotlinCoroutineTests.kt diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/src/testFixtures/groovy/datadog/trace/instrumentation/kotlin/coroutines/AbstractKotlinCoroutineInstrumentationTest.groovy b/dd-java-agent/instrumentation/kotlin-coroutines/src/testFixtures/groovy/datadog/trace/instrumentation/kotlin/coroutines/AbstractKotlinCoroutineInstrumentationTest.groovy index fa67cbfa9e9..74b81c92ed7 100644 --- a/dd-java-agent/instrumentation/kotlin-coroutines/src/testFixtures/groovy/datadog/trace/instrumentation/kotlin/coroutines/AbstractKotlinCoroutineInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/kotlin-coroutines/src/testFixtures/groovy/datadog/trace/instrumentation/kotlin/coroutines/AbstractKotlinCoroutineInstrumentationTest.groovy @@ -387,7 +387,7 @@ abstract class AbstractKotlinCoroutineInstrumentationTest