Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only include exporters in -all jar. #3286

Merged
merged 3 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions javaagent-exporters/javaagent-exporters.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Project to collect and shade exporter dependencies included in the agent's full distribution.

plugins {
id "otel.shadow-conventions"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so great

}

apply from: "$rootDir/gradle/java.gradle"

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"

implementation "io.grpc:grpc-netty-shaded:1.35.1"
}
20 changes: 9 additions & 11 deletions javaagent-tooling/javaagent-tooling.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,9 @@ dependencies {
exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk-common'
}

implementation "io.opentelemetry:opentelemetry-exporter-jaeger"
// 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"
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"

api "net.bytebuddy:byte-buddy"
implementation "net.bytebuddy:byte-buddy-agent"
Expand All @@ -53,11 +46,16 @@ dependencies {
implementation "org.slf4j:slf4j-api"
implementation "com.google.guava:guava"

implementation "io.grpc:grpc-netty-shaded:1.35.1"

testImplementation project(':testing-common')
testImplementation "org.assertj:assertj-core"
testImplementation "org.mockito:mockito-core"

instrumentationMuzzle sourceSets.main.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"
}
6 changes: 4 additions & 2 deletions javaagent/javaagent.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ CopySpec isolateSpec(Collection<Project> projectsWithShadowJar) {

//Includes everything needed for OOTB experience
shadowJar {
dependsOn ':instrumentation:shadowJar'
def projectsWithShadowJar = [project(':instrumentation')]
def projectsWithShadowJar = [project(':instrumentation'), project(":javaagent-exporters")]
projectsWithShadowJar.each {
dependsOn("${it.path}:shadowJar")
}
with isolateSpec(projectsWithShadowJar)
}

Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ include ':opentelemetry-api-shaded-for-instrumenting'
include ':opentelemetry-ext-annotations-shaded-for-instrumenting'
include ':javaagent-bootstrap'
include ':javaagent-bootstrap-tests'
include ':javaagent-exporters'
include ':javaagent-extension-api'
include ':javaagent-tooling'
include ':javaagent'
Expand Down