diff --git a/exporters/logging-otlp/build.gradle.kts b/exporters/logging-otlp/build.gradle.kts index a65f52f8522..07a2044b5f3 100644 --- a/exporters/logging-otlp/build.gradle.kts +++ b/exporters/logging-otlp/build.gradle.kts @@ -20,6 +20,5 @@ dependencies { testImplementation(project(":sdk:testing")) - testImplementation("com.google.guava:guava") testImplementation("org.skyscreamer:jsonassert") } diff --git a/exporters/logging-otlp/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider b/exporters/logging-otlp/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider index 20763b2e4e5..dcd615d81b2 100644 --- a/exporters/logging-otlp/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider +++ b/exporters/logging-otlp/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider @@ -1,2 +1 @@ io.opentelemetry.exporter.logging.otlp.internal.logs.LoggingLogRecordExporterProvider -io.opentelemetry.exporter.logging.otlp.internal.logs.OtlpStdoutLogRecordExporterProvider diff --git a/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfiguration.java b/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfiguration.java index 712be02a18e..4f506fb5a07 100644 --- a/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfiguration.java +++ b/sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfiguration.java @@ -30,7 +30,7 @@ final class LogRecordExporterConfiguration { EXPORTER_ARTIFACT_ID_BY_NAME.put("console", "opentelemetry-exporter-logging"); EXPORTER_ARTIFACT_ID_BY_NAME.put("logging", "opentelemetry-exporter-logging"); EXPORTER_ARTIFACT_ID_BY_NAME.put("logging-otlp", "opentelemetry-exporter-logging-otlp"); - EXPORTER_ARTIFACT_ID_BY_NAME.put("otlp-stdout", "opentelemetry-exporter-logging-otlp"); + EXPORTER_ARTIFACT_ID_BY_NAME.put("otlp/stdout", "opentelemetry-sdk-extensions-incubator"); EXPORTER_ARTIFACT_ID_BY_NAME.put("otlp", "opentelemetry-exporter-otlp"); } diff --git a/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfigurationTest.java b/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfigurationTest.java index 52d4cb79a4e..f37f1756de3 100644 --- a/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfigurationTest.java +++ b/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfigurationTest.java @@ -46,10 +46,10 @@ void configureExporter_KnownSpiExportersNotOnClasspath() { .hasMessage( "otel.logs.exporter set to \"logging-otlp\" but opentelemetry-exporter-logging-otlp" + " not found on classpath. Make sure to add it as a dependency."); - assertThatThrownBy(() -> configureExporter("otlp-stdout", spiExportersManager)) + assertThatThrownBy(() -> configureExporter("otlp/stdout", spiExportersManager)) .isInstanceOf(ConfigurationException.class) .hasMessage( - "otel.logs.exporter set to \"otlp-stdout\" but opentelemetry-exporter-logging-otlp" + "otel.logs.exporter set to \"otlp/stdout\" but opentelemetry-exporter-logging-otlp" + " not found on classpath. Make sure to add it as a dependency."); assertThatThrownBy(() -> configureExporter("otlp", spiExportersManager)) .isInstanceOf(ConfigurationException.class) diff --git a/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfigurationTest.java b/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfigurationTest.java index ad08186b690..3b7035a073d 100644 --- a/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfigurationTest.java +++ b/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/LogRecordExporterConfigurationTest.java @@ -39,7 +39,7 @@ void configureExporter_KnownSpiExportersOnClasspath() { assertThat( LogRecordExporterConfiguration.configureExporter("logging-otlp", spiExportersManager)) .isInstanceOf(OtlpJsonLoggingLogRecordExporter.class); - assertThat(LogRecordExporterConfiguration.configureExporter("otlp-stdout", spiExportersManager)) + assertThat(LogRecordExporterConfiguration.configureExporter("otlp/stdout", spiExportersManager)) .isInstanceOf(OtlpStdoutLogRecordExporter.class); assertThat(LogRecordExporterConfiguration.configureExporter("otlp", spiExportersManager)) .isInstanceOf(OtlpGrpcLogRecordExporter.class); diff --git a/sdk-extensions/incubator/build.gradle.kts b/sdk-extensions/incubator/build.gradle.kts index f562360655e..1d26550d824 100644 --- a/sdk-extensions/incubator/build.gradle.kts +++ b/sdk-extensions/incubator/build.gradle.kts @@ -29,6 +29,7 @@ dependencies { api("com.fasterxml.jackson.core:jackson-annotations") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") implementation(project(":sdk-extensions:autoconfigure")) + implementation(project(":exporters:logging-otlp")) testImplementation(project(":sdk:testing")) testImplementation(project(":sdk-extensions:autoconfigure")) @@ -43,6 +44,7 @@ dependencies { testImplementation("com.linecorp.armeria:armeria-junit5") testImplementation("com.google.guava:guava-testlib") + testImplementation("org.skyscreamer:jsonassert") } // The following tasks download the JSON Schema files from open-telemetry/opentelemetry-configuration and generate classes from the type definitions which are used with jackson-databind to parse JSON / YAML to the configuration schema. diff --git a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterComponentProvider.java b/sdk-extensions/incubator/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterComponentProvider.java similarity index 97% rename from exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterComponentProvider.java rename to sdk-extensions/incubator/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterComponentProvider.java index ae576d9e332..3d28ab9dd5d 100644 --- a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterComponentProvider.java +++ b/sdk-extensions/incubator/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterComponentProvider.java @@ -25,7 +25,7 @@ public Class getType() { @Override public String getName() { - return "otlp-stdout"; + return "otlp/stdout"; } @Override diff --git a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterProvider.java b/sdk-extensions/incubator/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterProvider.java similarity index 97% rename from exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterProvider.java rename to sdk-extensions/incubator/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterProvider.java index befb6297c45..934803705ac 100644 --- a/exporters/logging-otlp/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterProvider.java +++ b/sdk-extensions/incubator/src/main/java/io/opentelemetry/exporter/logging/otlp/internal/logs/OtlpStdoutLogRecordExporterProvider.java @@ -24,6 +24,6 @@ public LogRecordExporter createExporter(ConfigProperties config) { @Override public String getName() { - return "otlp-stdout"; + return "otlp/stdout"; } } diff --git a/exporters/logging-otlp/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider b/sdk-extensions/incubator/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider similarity index 100% rename from exporters/logging-otlp/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider rename to sdk-extensions/incubator/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider diff --git a/sdk-extensions/incubator/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider b/sdk-extensions/incubator/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider new file mode 100644 index 00000000000..11b4ddccda2 --- /dev/null +++ b/sdk-extensions/incubator/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider @@ -0,0 +1 @@ +io.opentelemetry.exporter.logging.otlp.internal.logs.OtlpStdoutLogRecordExporterProvider diff --git a/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/AbstractOtlpStdoutExporterTest.java b/sdk-extensions/incubator/src/test/java/io/opentelemetry/exporter/logging/otlp/AbstractOtlpStdoutExporterTest.java similarity index 99% rename from exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/AbstractOtlpStdoutExporterTest.java rename to sdk-extensions/incubator/src/test/java/io/opentelemetry/exporter/logging/otlp/AbstractOtlpStdoutExporterTest.java index 0e52b011d49..cba01d599ce 100644 --- a/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/AbstractOtlpStdoutExporterTest.java +++ b/sdk-extensions/incubator/src/test/java/io/opentelemetry/exporter/logging/otlp/AbstractOtlpStdoutExporterTest.java @@ -104,8 +104,8 @@ private String output(@Nullable OutputStream outputStream, @Nullable Path file) } } - @BeforeAll @SuppressWarnings("SystemOut") + @BeforeAll static void setUpStatic() { systemOut = System.out; System.setOut(SYSTEM_OUT_PRINT_STREAM); @@ -233,7 +233,7 @@ protected OtlpStdoutLogRecordExporter exporterFromComponentProvider( .filter( p -> { ComponentProvider c = (ComponentProvider) p; - return "otlp-stdout".equals(c.getName()) + return "otlp/stdout".equals(c.getName()) && c.getType().equals(componentProviderType); }) .findFirst() diff --git a/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/OtlpStdoutLogRecordExporterTest.java b/sdk-extensions/incubator/src/test/java/io/opentelemetry/exporter/logging/otlp/OtlpStdoutLogRecordExporterTest.java similarity index 98% rename from exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/OtlpStdoutLogRecordExporterTest.java rename to sdk-extensions/incubator/src/test/java/io/opentelemetry/exporter/logging/otlp/OtlpStdoutLogRecordExporterTest.java index 6e5e70950e3..40f81a3f565 100644 --- a/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/OtlpStdoutLogRecordExporterTest.java +++ b/sdk-extensions/incubator/src/test/java/io/opentelemetry/exporter/logging/otlp/OtlpStdoutLogRecordExporterTest.java @@ -20,7 +20,7 @@ class OtlpStdoutLogRecordExporterTest public OtlpStdoutLogRecordExporterTest() { super( - "otlp-stdout", + "otlp/stdout", TestDataExporter.forLogs(), OtlpStdoutLogRecordExporter.class, ConfigurableLogRecordExporterProvider.class, diff --git a/exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/TestDataExporter.java b/sdk-extensions/incubator/src/test/java/io/opentelemetry/exporter/logging/otlp/TestDataExporter.java similarity index 100% rename from exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/TestDataExporter.java rename to sdk-extensions/incubator/src/test/java/io/opentelemetry/exporter/logging/otlp/TestDataExporter.java diff --git a/exporters/logging-otlp/src/test/resources/expected-logs-wrapper.json b/sdk-extensions/incubator/src/test/resources/expected-logs-wrapper.json similarity index 100% rename from exporters/logging-otlp/src/test/resources/expected-logs-wrapper.json rename to sdk-extensions/incubator/src/test/resources/expected-logs-wrapper.json diff --git a/exporters/logging-otlp/src/test/resources/expected-logs.json b/sdk-extensions/incubator/src/test/resources/expected-logs.json similarity index 100% rename from exporters/logging-otlp/src/test/resources/expected-logs.json rename to sdk-extensions/incubator/src/test/resources/expected-logs.json