Rename javaagent modules (#952)

This commit is contained in:
Trask Stalnaker 2020-08-12 22:50:14 -07:00 committed by GitHub
parent 1816eb9cbe
commit bf9c160570
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
133 changed files with 189 additions and 186 deletions

View File

@ -9,5 +9,5 @@ set -e
LIBS_DIR=./libs/
mkdir -p $LIBS_DIR >/dev/null 2>&1
cp workspace/opentelemetry-javaagent/build/libs/*.jar $LIBS_DIR/
cp workspace/javaagent/build/libs/*.jar $LIBS_DIR/
cp workspace/auto-exporters/*/build/libs/*.jar $LIBS_DIR/

View File

@ -38,7 +38,7 @@ and then generate the -all artifact
and then you can find the java agent artifact at
`opentelemetry-javaagent/build/lib/opentelemetry-javaagent-<version>-all.jar`.
`javaagent/build/lib/opentelemetry-javaagent-<version>-all.jar`.
### IntelliJ setup

View File

@ -5,7 +5,7 @@ plugins {
apply from: "$rootDir/gradle/java.gradle"
dependencies {
testImplementation project(':auto-tooling')
testImplementation project(':javaagent-tooling')
testImplementation deps.opentelemetrySdkAutoConfig
testImplementation project(':auto-exporters:opentelemetry-auto-exporter-otlp')

View File

@ -1,5 +1,5 @@
dependencies {
implementation project(':auto-bootstrap')
implementation project(':javaagent-bootstrap')
implementation project(':benchmark-integration')
implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.1.v20170120'

View File

@ -22,7 +22,7 @@ dependencies {
implementation "com.typesafe.play:play-logback_$scalaVersion:$playVersion"
implementation "com.typesafe.play:filters-helpers_$scalaVersion:$playVersion"
implementation project(':auto-bootstrap')
implementation project(':javaagent-bootstrap')
implementation project(':benchmark-integration')
}

View File

@ -49,7 +49,7 @@ jmh {
jmhVersion = '1.23' // Specifies JMH version
}
tasks.jmh.dependsOn(':opentelemetry-javaagent:shadowJar')
tasks.jmh.dependsOn(':javaagent:shadowJar')
/*
If using libasyncProfiler, use the following to generate nice svg flamegraphs.

View File

@ -47,6 +47,6 @@ public class ClassRetransformingBenchmark {
@Fork(
jvmArgsAppend =
"-javaagent:/path/to/opentelemetry-java-instrumentation"
+ "/opentelemetry-javaagent/build/libs/opentelemetry-javaagent.jar")
+ "/javaagent/build/libs/opentelemetry-javaagent.jar")
public static class WithAgent extends ClassRetransformingBenchmark {}
}

View File

@ -80,6 +80,6 @@ public class TypeMatchingBenchmark {
@Fork(
jvmArgsAppend =
"-javaagent:/path/to/opentelemetry-java-instrumentation"
+ "/opentelemetry-javaagent/build/libs/opentelemetry-javaagent.jar")
+ "/javaagent/build/libs/opentelemetry-javaagent.jar")
public static class WithAgent extends TypeMatchingBenchmark {}
}

View File

@ -55,8 +55,8 @@ class MuzzlePlugin implements Plugin<Project> {
@Override
void apply(Project project) {
def bootstrapProject = project.rootProject.getChildProjects().get('auto-bootstrap')
def toolingProject = project.rootProject.getChildProjects().get('auto-tooling')
def bootstrapProject = project.rootProject.getChildProjects().get('javaagent-bootstrap')
def toolingProject = project.rootProject.getChildProjects().get('javaagent-tooling')
project.extensions.create("muzzle", MuzzleExtension, project.objects)
// compileMuzzle compiles all projects required to run muzzle validation.

View File

@ -9,7 +9,7 @@ into 3 parts:
### Modules that live in the system class loader
#### `opentelemetry-javaagent` module
#### `javaagent` module
This module consists of single class
`io.opentelemetry.auto.bootstrap.AgentBootstrap` which implements [Java
@ -23,7 +23,7 @@ class from there.
### Modules that live in the bootstrap class loader
#### `agent-bootstrap` module
#### `javaagent-bootstrap` module
`io.opentelemetry.auto.bootstrap.Agent` and a few other classes that live in the bootstrap class
loader but are not used directly by auto-instrumentation
@ -32,7 +32,7 @@ loader but are not used directly by auto-instrumentation
These modules contains support classes for actual instrumentations to be loaded
later and separately. These classes should be available from all possible
classloaders in the running application. For this reason `java-agent` puts
classloaders in the running application. For this reason the `javaagent` module puts
all these classes into JVM's bootstrap classloader. For the same reason this
module should be as small as possible and have as few dependencies as
possible. Otherwise, there is a risk of accidentally exposing this classes to
@ -43,7 +43,7 @@ while `auto-api` contains classes that are only needed for auto-instrumentation.
### Modules that live in the agent class loader
#### `agent-tooling` module and `instrumentation` submodules
#### `javaagent-tooling` module and `instrumentation` submodules
Contains everything necessary to make instrumentation machinery work,
including integration with [ByteBuddy](https://bytebuddy.net/) and actual
@ -51,8 +51,8 @@ library-specific instrumentations. As these classes depend on many classes
from different libraries, it is paramount to hide all these classes from the
host application. This is achieved in the following way:
- When `java-agent` module builds the final agent, it moves all classes from
`instrumentation` submodules and `agent-tooling` module into a separate
- When `javaagent` module builds the final agent, it moves all classes from
`instrumentation` submodules and `javaagent-tooling` module into a separate
folder inside final jar file, called`inst`.
In addition, the extension of all class files is changed from `class` to `classdata`.
This ensures that general classloaders cannot find nor load these classes.
@ -71,17 +71,17 @@ still access helper classes from bootstrap classloader.
#### Agent jar structure
If you now look inside
`opentelemetry-javaagent/build/libs/opentelemetry-javaagent-<version>-all.jar`, you will see the
`javaagent/build/libs/opentelemetry-javaagent-<version>-all.jar`, you will see the
following "clusters" of classes:
Available in the system class loader:
- `io/opentelemetry/auto/bootstrap/AgentBootstrap` - the one class from `opentelemetry-javaagent`
- `io/opentelemetry/auto/bootstrap/AgentBootstrap` - the one class from `javaagent`
module
Available in the bootstrap class loader:
- `io/opentelemetry/auto/bootstrap/` - contains the `agent-bootstrap` module
- `io/opentelemetry/auto/bootstrap/` - contains the `javaagent-bootstrap` module
- `io/opentelemetry/instrumentation/auto/api/` - contains the `auto-api` module
- `io/opentelemetry/auto/shaded/instrumentation/api/` - contains the `instrumentation-api` module,
shaded during creation of `javaagent` jar file by Shadow Gradle plugin
@ -91,6 +91,6 @@ Context, both shaded during creation of `javaagent` jar file by Shadow Gradle pl
during creation of `javaagent` jar file by Shadow Gradle plugin
Available in the agent class loader:
- `inst/` - contains `agent-tooling` module and `instrumentation` submodules, loaded and isolated
- `inst/` - contains `javaagent-tooling` module and `instrumentation` submodules, loaded and isolated
inside `AgentClassLoader`. Including OpenTelemetry SDK (and the built-in exporters when using the
`-all` artifact).

View File

@ -31,7 +31,7 @@ afterEvaluate {
transformation {
tasks = ['compileJava', 'compileScala', 'compileKotlin']
plugin = 'io.opentelemetry.auto.tooling.muzzle.MuzzleGradlePlugin'
classPath = project(':auto-tooling').configurations.instrumentationMuzzle + configurations.runtimeClasspath + sourceSets.main.output
classPath = project(':javaagent-tooling').configurations.instrumentationMuzzle + configurations.runtimeClasspath + sourceSets.main.output
}
}
@ -39,7 +39,7 @@ afterEvaluate {
implementation project(':library-api')
implementation project(':auto-api')
// Apply common dependencies for instrumentation.
implementation(project(':auto-tooling')) {
implementation(project(':javaagent-tooling')) {
// OpenTelemetry SDK is not needed for compilation, and :opentelemetry-sdk-shaded-for-testing
// is brought in for tests by project(:testing-common) below
exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk'

View File

@ -12,7 +12,7 @@ apply from: "$rootDir/gradle/spotbugs.gradle"
def applyCodeCoverage = !(
project.path.startsWith(":smoke-tests") ||
//TODO why some tests fail on java 11 if jacoco is present?
project.path == ":opentelemetry-javaagent" ||
project.path == ":javaagent" ||
project.path == ":load-generator" ||
project.path.startsWith(":benchmark") ||
project.path.startsWith(":instrumentation"))

View File

@ -72,7 +72,7 @@ muzzle {
dependencies {
compileOnly group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '10.0.0'
implementation project(':auto-tooling')
implementation project(':javaagent-tooling')
implementation deps.autoservice
annotationProcessor deps.autoservice

View File

@ -2,5 +2,5 @@ apply from: "$rootDir/gradle/instrumentation.gradle"
dependencies {
compileOnly group: 'org.elasticsearch.client', name: 'rest', version: '5.0.0'
implementation project(':auto-tooling')
implementation project(':javaagent-tooling')
}

View File

@ -2,5 +2,5 @@ apply from: "$rootDir/gradle/instrumentation.gradle"
dependencies {
compileOnly group: 'org.elasticsearch', name: 'elasticsearch', version: '2.0.0'
implementation project(':auto-tooling')
implementation project(':javaagent-tooling')
}

View File

@ -36,8 +36,8 @@ subprojects {
dependencies {
implementation project(':library-api')
implementation project(':auto-api')
implementation(project(':auto-tooling')) {
exclude module: ':auto-bootstrap'
implementation(project(':javaagent-tooling')) {
exclude module: ':javaagent-bootstrap'
}
}
@ -60,7 +60,7 @@ shadowJar {
duplicatesStrategy = DuplicatesStrategy.FAIL
dependencies {
exclude(project(':auto-bootstrap'))
exclude(project(':javaagent-bootstrap'))
}
// rewrite library instrumentation dependencies

View File

@ -24,7 +24,7 @@ dependencies {
compileOnly(group: 'io.kubernetes', name: 'client-java-api', version: '7.0.0')
implementation project(':auto-tooling')
implementation project(':javaagent-tooling')
testImplementation group: 'io.kubernetes', name: 'client-java-api', version: '7.0.0'

View File

@ -23,7 +23,7 @@ testSets {
dependencies {
compileOnly(group: 'com.squareup.okhttp', name: 'okhttp', version: '2.2.0')
implementation project(':auto-tooling')
implementation project(':javaagent-tooling')
testImplementation project(':instrumentation:java-concurrent')
testImplementation group: 'com.squareup.okhttp', name: 'okhttp', version: '2.2.0'

View File

@ -28,7 +28,7 @@ not transitive.
dependencies {
compileOnly(group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.0.0')
implementation project(':auto-tooling')
implementation project(':javaagent-tooling')
testImplementation(project(':testing-common')) {
exclude module: 'okhttp'

View File

@ -1,3 +1,5 @@
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/publish.gradle"

View File

@ -1,3 +1,5 @@
group = 'io.opentelemetry.javaagent'
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/publish.gradle"
@ -11,7 +13,7 @@ configurations {
}
dependencies {
implementation project(':auto-bootstrap')
implementation project(':javaagent-bootstrap')
implementation project(':auto-api')
implementation project(':library-api')
implementation project(':utils:thread-utils')

Some files were not shown because too many files have changed in this diff Show More