Skip to content

Commit

Permalink
move provider to sdk-extensions/incubator and rename to otlp/stdout a…
Browse files Browse the repository at this point in the history
…s per spec
  • Loading branch information
zeitlinger committed Sep 6, 2024
1 parent c8c678d commit 3694af2
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 11 deletions.
1 change: 0 additions & 1 deletion exporters/logging-otlp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ dependencies {

testImplementation(project(":sdk:testing"))

testImplementation("com.google.guava:guava")
testImplementation("org.skyscreamer:jsonassert")
}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
io.opentelemetry.exporter.logging.otlp.internal.logs.LoggingLogRecordExporterProvider
io.opentelemetry.exporter.logging.otlp.internal.logs.OtlpStdoutLogRecordExporterProvider
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions sdk-extensions/incubator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Class<LogRecordExporter> getType() {

@Override
public String getName() {
return "otlp-stdout";
return "otlp/stdout";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public LogRecordExporter createExporter(ConfigProperties config) {

@Override
public String getName() {
return "otlp-stdout";
return "otlp/stdout";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.opentelemetry.exporter.logging.otlp.internal.logs.OtlpStdoutLogRecordExporterProvider
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OtlpStdoutLogRecordExporterTest

public OtlpStdoutLogRecordExporterTest() {
super(
"otlp-stdout",
"otlp/stdout",
TestDataExporter.forLogs(),
OtlpStdoutLogRecordExporter.class,
ConfigurableLogRecordExporterProvider.class,
Expand Down

0 comments on commit 3694af2

Please sign in to comment.