Use sdk_contrib exporter glue
MODIFY
agent-tooling/agent-tooling.gradle
agent-tooling/agent-tooling.gradle
@@ -21,9 +21,8 @@ dependencies {
compile deps.opentelemetryApi
compile deps.opentelemetrySdk
+ compile deps.opentelemetrySdkAutoConfig
- // TODO: This might have to live in opentelemetry-java
- compile project(':exporter-support')
compile group: 'com.blogspot.mydailyjava', name: 'weak-lock-free', version: '0.15'
compile deps.bytebuddy

RENAME
agent-tooling/src/main/java/io/opentelemetry/auto/tooling/DefaultConfigProvider.java
agent-tooling/src/main/java/io/opentelemetry/auto/tooling/DefaultExporterConfig.java
package io.opentelemetry.auto.tooling;
import io.opentelemetry.auto.config.Config;
-import io.opentelemetry.auto.exportersupport.ConfigProvider;
-public class DefaultConfigProvider implements ConfigProvider {
+public class DefaultExporterConfig implements io.opentelemetry.sdk.contrib.auto.config.Config {
private final String prefix;
- public DefaultConfigProvider(final String prefix) {
+ public DefaultExporterConfig(final String prefix) {
this.prefix = prefix;
}

MODIFY
agent-tooling/src/main/java/io/opentelemetry/auto/tooling/ExporterClassLoader.java
agent-tooling/src/main/java/io/opentelemetry/auto/tooling/ExporterClassLoader.java
@@ -62,7 +62,7 @@ public class ExporterClassLoader extends URLClassLoader {
// A small hack to prevent other exporters from being loaded by this classloader if they
// should happen to appear on the classpath.
if (name.equals(
- "META-INF/services/io.opentelemetry.auto.exportersupport.SpanExporterFactory")) {
+ "META-INF/services/io.opentelemetry.sdk.contrib.auto.config.SpanExporterFactory")) {
return findResources(name);
}
return super.getResources(name);

MODIFY
agent-tooling/src/main/java/io/opentelemetry/auto/tooling/TracerInstaller.java
agent-tooling/src/main/java/io/opentelemetry/auto/tooling/TracerInstaller.java
@@ -17,8 +17,8 @@ package io.opentelemetry.auto.tooling;
import com.google.common.annotations.VisibleForTesting;
import io.opentelemetry.auto.config.Config;
-import io.opentelemetry.auto.exportersupport.SpanExporterFactory;
import io.opentelemetry.sdk.OpenTelemetrySdk;
+import io.opentelemetry.sdk.contrib.auto.config.SpanExporterFactory;
import io.opentelemetry.sdk.trace.export.SimpleSpansProcessor;
import io.opentelemetry.sdk.trace.export.SpanExporter;
import java.io.File;
@@ -74,7 +74,7 @@ public class TracerInstaller {
log.warn(
"Exporter JAR defines more than one factory. Only the first one found will be used");
}
- return f.fromConfig(new DefaultConfigProvider("exporter"));
+ return f.fromConfig(new DefaultExporterConfig("exporter"));
}
log.warn("No matching providers in jar " + exporterJar);
return null;

MODIFY
exporter-adapters/jaeger-adapter/jaeger-adapter.gradle
exporter-adapters/jaeger-adapter/jaeger-adapter.gradle
@@ -6,6 +6,6 @@ apply from: "${rootDir}/gradle/java.gradle"
dependencies {
compile deps.opentelemetryJaeger
- compile project(':exporter-support')
+ compileOnly deps.opentelemetrySdkAutoConfig
compile group: 'io.grpc', name: 'grpc-api', version: '1.24.0'
}

MODIFY
exporter-adapters/jaeger-adapter/src/main/java/io/opentelemetry/auto/exporters/jaeger/JaegerExporterFactory.java
exporter-adapters/jaeger-adapter/src/main/java/io/opentelemetry/auto/exporters/jaeger/JaegerExporterFactory.java
@@ -17,9 +17,9 @@ package io.opentelemetry.auto.exporters.jaeger;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
-import io.opentelemetry.auto.exportersupport.ConfigProvider;
-import io.opentelemetry.auto.exportersupport.SpanExporterFactory;
import io.opentelemetry.exporters.jaeger.JaegerGrpcSpanExporter;
+import io.opentelemetry.sdk.contrib.auto.config.Config;
+import io.opentelemetry.sdk.contrib.auto.config.SpanExporterFactory;
import io.opentelemetry.sdk.trace.export.SpanExporter;
public class JaegerExporterFactory implements SpanExporterFactory {
@@ -34,7 +34,7 @@ public class JaegerExporterFactory implements SpanExporterFactory {
private static final String DEFAULT_SERVICE = "(unknown service)";
@Override
- public SpanExporter fromConfig(final ConfigProvider config) {
+ public SpanExporter fromConfig(final Config config) {
final String host = config.getString(HOST_CONFIG, null);
if (host == null) {
throw new IllegalArgumentException(HOST_CONFIG + " must be specified");

RENAME
exporter-adapters/jaeger-adapter/src/main/resources/META-INF/services/io.opentelemetry.auto.exportersupport.SpanExporterFactory
exporter-adapters/jaeger-adapter/src/main/resources/META-INF/services/io.opentelemetry.sdk.contrib.auto.config.SpanExporterFactory
MODIFY
exporter-adapters/logging-exporter-adapter/logging-exporter-adapter.gradle
exporter-adapters/logging-exporter-adapter/logging-exporter-adapter.gradle
@@ -7,6 +7,6 @@ apply from: "${rootDir}/gradle/java.gradle"
dependencies {
compileOnly deps.opentelemetrySdk
compileOnly deps.opentelemetryApi
- compile project(":exporter-support")
+ compileOnly deps.opentelemetrySdkAutoConfig
}

MODIFY
exporter-adapters/logging-exporter-adapter/src/main/java/io/opentelemetry/auto/exporters/loggingexporter/LoggingExporterFactory.java
exporter-adapters/logging-exporter-adapter/src/main/java/io/opentelemetry/auto/exporters/loggingexporter/LoggingExporterFactory.java
*/
package io.opentelemetry.auto.exporters.loggingexporter;
-import io.opentelemetry.auto.exportersupport.ConfigProvider;
-import io.opentelemetry.auto.exportersupport.SpanExporterFactory;
+import io.opentelemetry.sdk.contrib.auto.config.Config;
+import io.opentelemetry.sdk.contrib.auto.config.SpanExporterFactory;
import io.opentelemetry.sdk.trace.export.SpanExporter;
public class LoggingExporterFactory implements SpanExporterFactory {
@Override
- public SpanExporter fromConfig(final ConfigProvider config) {
+ public SpanExporter fromConfig(final Config config) {
return new LoggingExporter(config.getString("logging.prefix", "no-prefix"));
}
}

RENAME
exporter-adapters/logging-exporter-adapter/src/main/resources/META-INF/services/io.opentelemetry.auto.exportersupport.SpanExporterFactory
exporter-adapters/logging-exporter-adapter/src/main/resources/META-INF/services/io.opentelemetry.sdk.contrib.auto.config.SpanExporterFactory
MODIFY
exporter-adapters/src/test/groovy/io/opentelemetry/auto/exporteradapters/ExporterAdaptersTest.groovy
exporter-adapters/src/test/groovy/io/opentelemetry/auto/exporteradapters/ExporterAdaptersTest.groovy
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import io.opentelemetry.auto.exportersupport.SpanExporterFactory
import io.opentelemetry.auto.tooling.ExporterClassLoader
+import io.opentelemetry.sdk.contrib.auto.config.SpanExporterFactory
import spock.lang.Shared
import spock.lang.Specification

DELETE
exporter-support/exporter-support.gradle
-apply from: "${rootDir}/gradle/java.gradle"
-
-dependencies {
- compileOnly deps.opentelemetrySdk
-}

DELETE
exporter-support/src/main/java/io/opentelemetry/auto/exportersupport/ConfigProvider.java
-/*
- * Copyright 2020, OpenTelemetry Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.opentelemetry.auto.exportersupport;
-
-public interface ConfigProvider {
- String getString(String key, String defaultValue);
-
- int getInt(String key, int defaultValue);
-
- long getLong(String key, long defaultValue);
-
- boolean getBoolean(String key, boolean defaultValue);
-
- double getDouble(String key, double defaultValue);
-}

DELETE
exporter-support/src/main/java/io/opentelemetry/auto/exportersupport/SpanExporterFactory.java
-/*
- * Copyright 2020, OpenTelemetry Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.opentelemetry.auto.exportersupport;
-
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-
-public interface SpanExporterFactory {
- SpanExporter fromConfig(ConfigProvider config);
-}

MODIFY
gradle/dependencies.gradle
gradle/dependencies.gradle
@@ -22,6 +22,7 @@ ext {
// OpenTelemetry
opentelemetryApi : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-api', version: versions.opentelemetry),
opentelemetrySdk : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-sdk', version: versions.opentelemetry),
+ opentelemetrySdkAutoConfig: dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-sdk-contrib-auto-config', version: versions.opentelemetry),
opentelemetryJaeger : dependencies.create(group: 'io.opentelemetry', name: 'opentelemetry-exporters-jaeger', version: versions.opentelemetry),
// General

MODIFY
settings.gradle
settings.gradle
@@ -27,9 +27,6 @@ include ':agent-bootstrap'
include ':agent-tooling'
include ':load-generator'
-// exporter support
-include ':exporter-support'
-
// misc
include ':testing'
include ':utils:test-utils'

Use sdk_contrib exporter glue (#285)