-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate javaagent-* to kotlin dsl (#3434)
- Loading branch information
Anuraag Agrawal
authored
Jun 29, 2021
1 parent
c1a0333
commit c46761b
Showing
11 changed files
with
188 additions
and
186 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
plugins { | ||
id("otel.java-conventions") | ||
id("otel.jacoco-conventions") | ||
id("otel.publish-conventions") | ||
} | ||
|
||
group = "io.opentelemetry.javaagent" | ||
|
||
dependencies { | ||
api("io.opentelemetry:opentelemetry-api") | ||
compileOnly("io.opentelemetry:opentelemetry-sdk") | ||
|
||
implementation(project(":instrumentation-api")) | ||
implementation("org.slf4j:slf4j-api") | ||
|
||
compileOnly("com.google.auto.value:auto-value-annotations") | ||
annotationProcessor("com.google.auto.value:auto-value") | ||
|
||
testImplementation(project(":testing-common")) | ||
testImplementation("org.mockito:mockito-core") | ||
testImplementation("org.mockito:mockito-junit-jupiter") | ||
testImplementation("org.assertj:assertj-core") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
plugins { | ||
id("otel.java-conventions") | ||
id("otel.publish-conventions") | ||
} | ||
|
||
group = "io.opentelemetry.javaagent" | ||
|
||
// patch inner class from Caffeine to avoid ForkJoinTask from being loaded too early | ||
val patch = sourceSets.create("patch") | ||
patch.java {} | ||
|
||
tasks { | ||
named<Jar>("jar") { | ||
from(patch.output) { | ||
include("io/opentelemetry/instrumentation/api/internal/shaded/caffeine/cache/BoundedLocalCache\$PerformCleanupTask.class") | ||
} | ||
} | ||
} | ||
|
||
val instrumentationMuzzle by configurations.creating { | ||
isCanBeConsumed = true | ||
isCanBeResolved = false | ||
extendsFrom(configurations.implementation.get()) | ||
} | ||
|
||
dependencies { | ||
api("io.opentelemetry:opentelemetry-api") | ||
api("io.opentelemetry:opentelemetry-api-metrics") | ||
|
||
compileOnly("io.opentelemetry:opentelemetry-sdk") | ||
|
||
implementation(project(":instrumentation-api")) | ||
implementation(project(":javaagent-api")) | ||
|
||
implementation("org.slf4j:slf4j-api") | ||
implementation("org.slf4j:slf4j-simple") | ||
// ^ Generally a bad idea for libraries, but we're shadowing. | ||
|
||
testImplementation(project(":testing-common")) | ||
testImplementation("org.mockito:mockito-core") | ||
testImplementation("org.assertj:assertj-core") | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Project to collect and shade exporter dependencies included in the agent's full distribution. | ||
|
||
plugins { | ||
id("otel.java-conventions") | ||
id("otel.shadow-conventions") | ||
} | ||
|
||
dependencies { | ||
implementation("io.opentelemetry:opentelemetry-exporter-jaeger") | ||
implementation("io.opentelemetry:opentelemetry-exporter-otlp") | ||
implementation("io.opentelemetry:opentelemetry-exporter-otlp-metrics") | ||
|
||
implementation("io.opentelemetry:opentelemetry-exporter-prometheus") | ||
implementation("io.prometheus:simpleclient") | ||
implementation("io.prometheus:simpleclient_httpserver") | ||
|
||
implementation("io.opentelemetry:opentelemetry-exporter-zipkin") | ||
|
||
// TODO(anuraaga): Move version to dependency management | ||
implementation("io.grpc:grpc-netty-shaded:1.38.0") | ||
} | ||
|
||
configurations { | ||
implementation { | ||
exclude("io.opentelemetry", "opentelemetry-api") | ||
exclude("io.opentelemetry", "opentelemetry-api-metrics") | ||
exclude("io.opentelemetry", "opentelemetry-semconv") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
plugins { | ||
id("otel.java-conventions") | ||
id("otel.publish-conventions") | ||
} | ||
|
||
group = "io.opentelemetry.javaagent" | ||
|
||
val instrumentationMuzzle by configurations.creating { | ||
isCanBeConsumed = true | ||
isCanBeResolved = false | ||
// TODO(anuraaga): Should be compileClasspath? | ||
extendsFrom(configurations.api.get()) | ||
extendsFrom(configurations.implementation.get()) | ||
} | ||
|
||
dependencies { | ||
api("io.opentelemetry:opentelemetry-sdk") | ||
|
||
api("net.bytebuddy:byte-buddy") | ||
api("org.slf4j:slf4j-api") | ||
|
||
implementation(project(":instrumentation-api")) | ||
implementation(project(":javaagent-api")) | ||
// TODO: ideally this module should not depend on bootstrap, bootstrap should be an internal component | ||
implementation(project(":javaagent-bootstrap")) | ||
|
||
// metrics are unstable, do not expose as api | ||
implementation("io.opentelemetry:opentelemetry-sdk-metrics") | ||
|
||
instrumentationMuzzle(sourceSets.main.get().output) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
plugins { | ||
id("otel.java-conventions") | ||
id("otel.publish-conventions") | ||
} | ||
|
||
group = "io.opentelemetry.javaagent" | ||
|
||
val instrumentationMuzzle by configurations.creating { | ||
isCanBeConsumed = true | ||
isCanBeResolved = false | ||
extendsFrom(configurations.implementation.get()) | ||
} | ||
|
||
dependencies { | ||
// Only used during compilation by bytebuddy plugin | ||
compileOnly("com.google.guava:guava") | ||
|
||
implementation(project(":javaagent-bootstrap")) | ||
implementation(project(":javaagent-extension-api")) | ||
implementation(project(":javaagent-api")) | ||
implementation(project(":instrumentation-api")) | ||
|
||
implementation("io.opentelemetry:opentelemetry-api") | ||
implementation("io.opentelemetry:opentelemetry-api-metrics") | ||
implementation("io.opentelemetry:opentelemetry-sdk") | ||
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") | ||
implementation("io.opentelemetry:opentelemetry-sdk-metrics") | ||
implementation("io.opentelemetry:opentelemetry-extension-kotlin") | ||
implementation("io.opentelemetry:opentelemetry-extension-aws") | ||
implementation("io.opentelemetry:opentelemetry-extension-trace-propagators") | ||
implementation("io.opentelemetry:opentelemetry-sdk-extension-resources") | ||
|
||
// Only the logging exporter is included in our slim distribution so we include it here. | ||
// Other exporters are in javaagent-exporters | ||
implementation("io.opentelemetry:opentelemetry-exporter-logging") | ||
|
||
api("net.bytebuddy:byte-buddy") | ||
implementation("org.slf4j:slf4j-api") | ||
|
||
annotationProcessor("com.google.auto.service:auto-service") | ||
compileOnly("com.google.auto.service:auto-service") | ||
|
||
testImplementation(project(":testing-common")) | ||
testImplementation("com.google.guava:guava") | ||
testImplementation("org.assertj:assertj-core") | ||
testImplementation("org.mockito:mockito-core") | ||
testImplementation("org.mockito:mockito-junit-jupiter") | ||
|
||
instrumentationMuzzle(sourceSets.main.get().output) | ||
} | ||
|
||
// Here we only include autoconfigure but don"t include OTLP exporters to ensure they are only in | ||
// the full distribution. We need to override the default exporter setting of OTLP as a result. | ||
tasks { | ||
withType<Test>().configureEach { | ||
environment("OTEL_TRACES_EXPORTER", "none") | ||
environment("OTEL_METRICS_EXPORTER", "none") | ||
} | ||
} |