Skip to content

Commit

Permalink
Break out :exporters:common module (#4575)
Browse files Browse the repository at this point in the history
* Break out :exporters:common module

* Comment out readme links

* spot
  • Loading branch information
jack-berg committed Aug 8, 2022
1 parent 91bd17e commit 77be2e0
Show file tree
Hide file tree
Showing 56 changed files with 69 additions and 29 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ dependency as follows, replacing `{{artifact-id}}` with the value from the "Arti
| [OTLP Logging Exporter](./exporters/logging-otlp) | Logging exporters in OTLP protobuf JSON format, including metrics, traces, and logs | `opentelemetry-exporter-logging-otlp` | <!--VERSION_STABLE-->1.16.0<!--/VERSION_STABLE--> |
| [Zipkin Exporter](./exporters/zipkin) | Zipkin trace exporter | `opentelemetry-exporter-zipkin` | <!--VERSION_STABLE-->1.16.0<!--/VERSION_STABLE--> |
| [Prometheus Exporter](./exporters/prometheus) | Prometheus metric exporter | `opentelemetry-exporter-prometheus` | <!--VERSION_UNSTABLE-->1.16.0-alpha<!--/VERSION_UNSTABLE--> |
| [Exporter Common](./exporters/common) | Shared exporter components (internal) | `opentelemetry-exporter-common` | TODO: add version once published in 1.17.0 |

### SDK Extensions

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
8 changes: 8 additions & 0 deletions exporters/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# OpenTelemetry - Exporter Common

<!-- TODO: uncomment once published
[![Javadocs][javadoc-image]][javadoc-url]
[javadoc-image]: https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-common.svg
[javadoc-url]: https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-common
-->
39 changes: 39 additions & 0 deletions exporters/common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
plugins {
id("otel.java-conventions")
id("otel.publish-conventions")

id("otel.animalsniffer-conventions")
}

description = "OpenTelemetry Exporter Common"
otelJava.moduleName.set("io.opentelemetry.exporter.internal")

val versions: Map<String, String> by project
dependencies {
api(project(":api:all"))

compileOnly(project(":sdk:common"))

compileOnly("org.codehaus.mojo:animal-sniffer-annotations")

annotationProcessor("com.google.auto.value:auto-value")

// We include helpers shared by gRPC or okhttp exporters but do not want to impose these
// dependency on all of our consumers.
compileOnly("com.fasterxml.jackson.core:jackson-core")
compileOnly("com.squareup.okhttp3:okhttp")
compileOnly("io.grpc:grpc-netty")
compileOnly("io.grpc:grpc-netty-shaded")
compileOnly("io.grpc:grpc-okhttp")
compileOnly("io.grpc:grpc-stub")

testImplementation(project(":sdk:common"))

testImplementation("com.google.protobuf:protobuf-java-util")
testImplementation("com.squareup.okhttp3:okhttp")
testImplementation("com.linecorp.armeria:armeria-junit5")
testImplementation("org.skyscreamer:jsonassert")
testImplementation("com.google.api.grpc:proto-google-common-protos")
testImplementation("io.grpc:grpc-testing")
testRuntimeOnly("io.grpc:grpc-netty-shaded")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

/** Utilities for exporter authentication. */
@ParametersAreNonnullByDefault
package io.opentelemetry.exporter.internal.auth;

import javax.annotation.ParametersAreNonnullByDefault;
5 changes: 2 additions & 3 deletions exporters/jaeger/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ dependencies {

protoSource(project(":exporters:jaeger-proto"))

// TODO(anuraaga): otlp-common has a lot of code not specific to OTLP now. As it's just internal
// code, this mysterious dependency is possibly still OK but we may need a rename or splitting.
implementation(project(":exporters:otlp:common"))
implementation(project(":exporters:common"))
implementation(project(":semconv"))

compileOnly("io.grpc:grpc-stub")

implementation("com.squareup.okhttp3:okhttp")
implementation("com.fasterxml.jackson.jr:jackson-jr-objects")

testImplementation(project(":exporters:jaeger-proto"))
Expand Down
23 changes: 2 additions & 21 deletions exporters/otlp/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,14 @@ val versions: Map<String, String> by project
dependencies {
protoSource("io.opentelemetry.proto:opentelemetry-proto:${versions["io.opentelemetry.proto"]}")

api(project(":api:all"))
api(project(":exporters:common"))

compileOnly(project(":sdk:metrics"))
compileOnly(project(":sdk:trace"))
compileOnly(project(":sdk:logs"))

implementation("com.squareup.okhttp3:okhttp")

compileOnly("org.codehaus.mojo:animal-sniffer-annotations")

// We include helpers shared by gRPC or okhttp exporters but do not want to impose these
// dependency on all of our consumers.
compileOnly("com.fasterxml.jackson.core:jackson-core")
compileOnly("io.grpc:grpc-netty")
compileOnly("io.grpc:grpc-netty-shaded")
compileOnly("io.grpc:grpc-okhttp")
compileOnly("io.grpc:grpc-stub")

annotationProcessor("com.google.auto.value:auto-value")

testImplementation(project(":sdk:metrics"))
testImplementation(project(":sdk:trace"))
testImplementation(project(":sdk:logs"))
Expand All @@ -43,20 +31,13 @@ dependencies {

testImplementation("com.fasterxml.jackson.core:jackson-databind")
testImplementation("com.google.protobuf:protobuf-java-util")
testImplementation("com.linecorp.armeria:armeria-junit5")
testImplementation("io.opentelemetry.proto:opentelemetry-proto")
testImplementation("org.skyscreamer:jsonassert")
testImplementation("org.assertj:assertj-core")

testImplementation("com.google.api.grpc:proto-google-common-protos")
testImplementation("io.grpc:grpc-testing")
testRuntimeOnly("io.grpc:grpc-netty-shaded")

jmhImplementation(project(":sdk:testing"))
jmhImplementation(project(":sdk-extensions:resources"))
jmhImplementation("com.fasterxml.jackson.core:jackson-core")
jmhImplementation("io.opentelemetry.proto:opentelemetry-proto")
jmhRuntimeOnly("io.grpc:grpc-netty")
jmhImplementation("io.grpc:grpc-netty")
}

wire {
Expand Down
1 change: 1 addition & 0 deletions sdk-extensions/autoconfigure/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
api(project(":sdk-extensions:autoconfigure-spi"))

implementation(project(":semconv"))
implementation(project(":exporters:common"))

compileOnly(project(":exporters:jaeger"))
compileOnly(project(":exporters:logging"))
Expand Down
8 changes: 3 additions & 5 deletions sdk-extensions/jaeger-remote-sampler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ dependencies {
compileOnly(project(":sdk-extensions:autoconfigure"))

implementation(project(":sdk:all"))

// TODO(anuraaga): otlp-common has a lot of code not specific to OTLP now. As it's just internal
// code, this mysterious dependency is possibly still OK but we may need a rename or splitting.
implementation(project(":exporters:otlp:common"))
implementation(project(":exporters:common"))

implementation("com.squareup.okhttp3:okhttp")

Expand All @@ -39,13 +36,14 @@ testing {
val testGrpcNetty by registering(JvmTestSuite::class) {
dependencies {
implementation(project(":sdk:testing"))
implementation(project(":exporters:common"))

implementation("com.google.protobuf:protobuf-java-util")
implementation("com.linecorp.armeria:armeria-junit5")
implementation("com.linecorp.armeria:armeria-grpc-protocol")
implementation("org.testcontainers:junit-jupiter")
implementation("io.grpc:grpc-netty")
implementation("io.grpc:grpc-stub")
implementation(project(":exporters:otlp:common"))
}
}
}
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ include(":extensions:aws")
include(":extensions:kotlin")
include(":extensions:noop-api")
include(":extensions:trace-propagators")
include(":exporters:common")
include(":exporters:jaeger")
include(":exporters:jaeger-proto")
include(":exporters:jaeger-thrift")
Expand Down

0 comments on commit 77be2e0

Please sign in to comment.