From 7215363b543814c2270f3f1f2aeeeef7b4949ac7 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Fri, 5 Jan 2024 14:38:04 -0600 Subject: [PATCH 1/4] Add zstd compressor implementation for OTLP exporters --- .../kotlin/otel.java-conventions.gradle.kts | 10 +- compressors/build.gradle.kts | 10 ++ compressors/zstd/build.gradle.kts | 21 +++ .../compressor/zstd/ZstdCompressor.java | 32 ++++ .../zstd/ZstdCompressorProvider.java | 16 ++ ...er.internal.compression.CompressorProvider | 1 + .../zstd/ZstdCompressorProviderTest.java | 162 ++++++++++++++++++ .../compressor/zstd/ZstdCompressorTest.java | 37 ++++ dependencyManagement/build.gradle.kts | 1 + settings.gradle.kts | 1 + 10 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 compressors/build.gradle.kts create mode 100644 compressors/zstd/build.gradle.kts create mode 100644 compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java create mode 100644 compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java create mode 100644 compressors/zstd/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider create mode 100644 compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java create mode 100644 compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java diff --git a/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts index a7553ca18..0663fffc3 100644 --- a/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts @@ -10,11 +10,17 @@ plugins { id("otel.spotless-conventions") } -val otelJava = extensions.create("otelJava") group = "io.opentelemetry.contrib" -base.archivesName.set("opentelemetry-${project.name}") +base { + // May be set already by a parent project, only set if not. + if (!archivesName.get().startsWith("opentelemetry-")) { + archivesName.set("opentelemetry-$name") + } +} + +val otelJava = extensions.create("otelJava") // Version to use to compile code and run tests. val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_17 diff --git a/compressors/build.gradle.kts b/compressors/build.gradle.kts new file mode 100644 index 000000000..eca03bdac --- /dev/null +++ b/compressors/build.gradle.kts @@ -0,0 +1,10 @@ +subprojects { + // https://github.com/gradle/gradle/issues/847 + group = "io.opentelemetry.compressors" + val proj = this + plugins.withId("java") { + configure { + archivesName.set("opentelemetry-compressor-${proj.name}") + } + } +} diff --git a/compressors/zstd/build.gradle.kts b/compressors/zstd/build.gradle.kts new file mode 100644 index 000000000..0ab76cb45 --- /dev/null +++ b/compressors/zstd/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("otel.java-conventions") + id("otel.publish-conventions") +} + +description = "zstd compressor implementation for use with OTLP exporters" +otelJava.moduleName.set("io.opentelemetry.contrib.compressor.zstd") + +dependencies { + // Use version from :depedencyManagement when opentelemetry-instrumentation-bom-alpha depends on opentelemetry-java 1.34.0 + var openTelemetryVersion = "1.34.0" + api("io.opentelemetry:opentelemetry-exporter-common:$openTelemetryVersion") + + implementation("com.github.luben:zstd-jni:1.5.5-10") + + testImplementation("io.opentelemetry:opentelemetry-sdk-testing:$openTelemetryVersion") + testImplementation("io.opentelemetry:opentelemetry-exporter-otlp:$openTelemetryVersion") + + testImplementation("io.opentelemetry.proto:opentelemetry-proto") + testImplementation("com.linecorp.armeria:armeria-junit5") +} diff --git a/compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java b/compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java new file mode 100644 index 000000000..0dd5296e7 --- /dev/null +++ b/compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java @@ -0,0 +1,32 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.contrib.compressor.zstd; + +import com.github.luben.zstd.ZstdOutputStream; +import io.opentelemetry.exporter.internal.compression.Compressor; +import java.io.IOException; +import java.io.OutputStream; + +public final class ZstdCompressor implements Compressor { + + private static final ZstdCompressor INSTANCE = new ZstdCompressor(); + + private ZstdCompressor() {} + + public static ZstdCompressor getInstance() { + return INSTANCE; + } + + @Override + public String getEncoding() { + return "zstd"; + } + + @Override + public OutputStream compress(OutputStream outputStream) throws IOException { + return new ZstdOutputStream(outputStream); + } +} diff --git a/compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java b/compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java new file mode 100644 index 000000000..8efc97e90 --- /dev/null +++ b/compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java @@ -0,0 +1,16 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.contrib.compressor.zstd; + +import io.opentelemetry.exporter.internal.compression.Compressor; +import io.opentelemetry.exporter.internal.compression.CompressorProvider; + +public final class ZstdCompressorProvider implements CompressorProvider { + @Override + public Compressor getInstance() { + return ZstdCompressor.getInstance(); + } +} diff --git a/compressors/zstd/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider b/compressors/zstd/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider new file mode 100644 index 000000000..50db09f2d --- /dev/null +++ b/compressors/zstd/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider @@ -0,0 +1 @@ +io.opentelemetry.contrib.compressor.zstd.ZstdCompressorProvider diff --git a/compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java b/compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java new file mode 100644 index 000000000..b543990f4 --- /dev/null +++ b/compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java @@ -0,0 +1,162 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.contrib.compressor.zstd; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.github.luben.zstd.ZstdInputStream; +import com.linecorp.armeria.common.HttpRequest; +import com.linecorp.armeria.common.HttpResponse; +import com.linecorp.armeria.common.HttpStatus; +import com.linecorp.armeria.common.MediaType; +import com.linecorp.armeria.server.ServerBuilder; +import com.linecorp.armeria.testing.junit5.server.ServerExtension; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.logs.Severity; +import io.opentelemetry.exporter.otlp.http.logs.OtlpHttpLogRecordExporter; +import io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; +import io.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; +import io.opentelemetry.proto.common.v1.AnyValue; +import io.opentelemetry.proto.common.v1.InstrumentationScope; +import io.opentelemetry.proto.common.v1.KeyValue; +import io.opentelemetry.proto.logs.v1.ResourceLogs; +import io.opentelemetry.proto.logs.v1.SeverityNumber; +import io.opentelemetry.sdk.common.InstrumentationScopeInfo; +import io.opentelemetry.sdk.logs.data.LogRecordData; +import io.opentelemetry.sdk.resources.Resource; +import io.opentelemetry.sdk.testing.logs.TestLogRecordData; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.time.Instant; +import java.util.Collections; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +class ZstdCompressorProviderTest { + + private static final HttpResponse SUCCESS = + HttpResponse.of( + HttpStatus.OK, + MediaType.parse("application/x-protobuf"), + ExportLogsServiceResponse.getDefaultInstance().toByteArray()); + + private static final ConcurrentLinkedQueue httpRequests = + new ConcurrentLinkedQueue<>(); + private static final ConcurrentLinkedQueue exportedTelemetry = + new ConcurrentLinkedQueue<>(); + + @RegisterExtension + static final ServerExtension server = + new ServerExtension() { + @Override + protected void configure(ServerBuilder sb) { + sb.service( + "/v1/logs", + (ctx, req) -> { + httpRequests.add(ctx.request()); + return HttpResponse.of( + req.aggregate() + .thenApply( + aggReq -> { + byte[] payload = aggReq.content().array(); + try { + if (req.headers().contains("content-encoding", "zstd")) { + ZstdInputStream is = + new ZstdInputStream(new ByteArrayInputStream(payload)); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + for (int result = is.read(); result != -1; result = is.read()) { + baos.write((byte) result); + } + payload = baos.toByteArray(); + } + ExportLogsServiceRequest parsed = + ExportLogsServiceRequest.parseFrom(payload); + exportedTelemetry.addAll(parsed.getResourceLogsList()); + return SUCCESS; + } catch (IOException e) { + throw new UncheckedIOException(e); + } + })); + }); + sb.http(0); + } + }; + + @Test + void exporterWithZstd() { + try (OtlpHttpLogRecordExporter exporter = + OtlpHttpLogRecordExporter.builder() + .setEndpoint(server.httpUri() + "/v1/logs") + .setCompression("zstd") + .build()) { + assertThat( + exporter + .export(Collections.singletonList(generateFakeLogRecordData())) + .join(10, TimeUnit.SECONDS) + .isSuccess()) + .isTrue(); + + assertThat(httpRequests) + .satisfiesExactly( + req -> assertThat(req.headers().contains("content-encoding", "zstd")).isTrue()); + assertThat(exportedTelemetry) + .satisfiesExactly( + resourceLogs -> + assertThat(resourceLogs.getScopeLogsList()) + .satisfiesExactly( + scopeLogs -> { + InstrumentationScope scope = scopeLogs.getScope(); + assertThat(scope.getName()).isEqualTo("testLib"); + assertThat(scope.getVersion()).isEqualTo("1.0"); + assertThat(scopeLogs.getSchemaUrl()).isEqualTo("http://url"); + assertThat(scopeLogs.getLogRecordsList()) + .satisfiesExactly( + logRecord -> { + assertThat(logRecord.getBody().getStringValue()) + .isEqualTo("log body"); + assertThat(logRecord.getAttributesList()) + .isEqualTo( + Collections.singletonList( + KeyValue.newBuilder() + .setKey("key") + .setValue( + AnyValue.newBuilder() + .setStringValue("value") + .build()) + .build())); + assertThat(logRecord.getSeverityText()).isEqualTo("INFO"); + assertThat(logRecord.getSeverityNumber()) + .isEqualTo(SeverityNumber.SEVERITY_NUMBER_INFO); + assertThat(logRecord.getTimeUnixNano()).isGreaterThan(0); + assertThat(logRecord.getObservedTimeUnixNano()) + .isGreaterThan(0); + }); + })); + } + } + + /** Generate a fake {@link LogRecordData}. */ + public static LogRecordData generateFakeLogRecordData() { + return TestLogRecordData.builder() + .setResource(Resource.getDefault()) + .setInstrumentationScopeInfo( + InstrumentationScopeInfo.builder("testLib") + .setVersion("1.0") + .setSchemaUrl("http://url") + .build()) + .setBody("log body") + .setAttributes(Attributes.builder().put("key", "value").build()) + .setSeverity(Severity.INFO) + .setSeverityText(Severity.INFO.name()) + .setTimestamp(Instant.now()) + .setObservedTimestamp(Instant.now().plusNanos(100)) + .build(); + } +} diff --git a/compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java b/compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java new file mode 100644 index 000000000..a0be3db96 --- /dev/null +++ b/compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java @@ -0,0 +1,37 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.contrib.compressor.zstd; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.github.luben.zstd.ZstdInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import org.junit.jupiter.api.Test; + +class ZstdCompressorTest { + + @Test + void roundTrip() throws IOException { + String content = "hello world"; + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + OutputStream os = ZstdCompressor.getInstance().compress(baos); + os.write(content.getBytes(StandardCharsets.UTF_8)); + os.close(); + + byte[] decompressed = new byte[content.length()]; + InputStream is = new ZstdInputStream(new ByteArrayInputStream(baos.toByteArray())); + is.read(decompressed); + is.close(); + + assertThat(new String(decompressed, StandardCharsets.UTF_8)).isEqualTo(content); + } +} diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 49151b910..42a061470 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -32,6 +32,7 @@ val CORE_DEPENDENCIES = listOf( "com.google.errorprone:error_prone_annotations:${errorProneVersion}", "com.google.errorprone:error_prone_core:${errorProneVersion}", "io.github.netmikey.logunit:logunit-jul:2.0.0", + "io.opentelemetry.proto:opentelemetry-proto:1.0.0-alpha", "io.prometheus:simpleclient:${prometheusVersion}", "io.prometheus:simpleclient_common:${prometheusVersion}", "io.prometheus:simpleclient_httpserver:${prometheusVersion}", diff --git a/settings.gradle.kts b/settings.gradle.kts index 4cc198498..ebc900e2e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -62,6 +62,7 @@ include(":all") include(":aws-resources") include(":aws-xray") include(":aws-xray-propagator") +include(":compressors:zstd") include(":consistent-sampling") include(":dependencyManagement") include(":disk-buffering") From 2b8d56f403ab6eece78d9d440c24cdf2bf2d7b90 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Fri, 5 Jan 2024 14:53:42 -0600 Subject: [PATCH 2/4] Add documentation and codeowners --- .github/component_owners.yml | 2 ++ README.md | 1 + compressors/zstd/README.md | 49 ++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 compressors/zstd/README.md diff --git a/.github/component_owners.yml b/.github/component_owners.yml index 930a5141d..0482f146b 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -19,6 +19,8 @@ components: aws-xray-propagator: - wangzlei - srprash + compressors: + - jack-berg consistent-sampling: - oertl - PeterF778 diff --git a/README.md b/README.md index d38018487..e60496bd3 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ feature or via instrumentation, this project is hopefully for you. * [AWS Resources](./aws-resources/README.md) * [AWS X-Ray SDK Support](./aws-xray/README.md) * [AWS X-Ray Propagator](./aws-xray-propagator/README.md) +* [zstd Compressor](./compressors/zstd/README.md) * [Consistent Sampling](./consistent-sampling/README.md) * [Disk Buffering](./disk-buffering/README.md) * [JMX Metric Gatherer](./jmx-metrics/README.md) diff --git a/compressors/zstd/README.md b/compressors/zstd/README.md new file mode 100644 index 000000000..dc969e4cc --- /dev/null +++ b/compressors/zstd/README.md @@ -0,0 +1,49 @@ +# zstd Compressor + +A [zstd](https://en.wikipedia.org/wiki/Zstd) implementation of [Compressor](https://github.com/open-telemetry/opentelemetry-java/blob/d9f9812d4375a4229caff43bd681c50b7a45776a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/compression/Compressor.java) and [CompressorProvider](https://github.com/open-telemetry/opentelemetry-java/blob/d9f9812d4375a4229caff43bd681c50b7a45776a/exporters/common/src/main/java/io/opentelemetry/exporter/internal/compression/CompressorProvider.java) based on [luben/zstd-jni](https://github.com/luben/zstd-jni). + +This enables zstd compression with [opentelemetry-java's](https://github.com/open-telemetry/opentelemetry-java) [OTLP exporters](https://opentelemetry.io/docs/instrumentation/java/exporters/#otlp). + +## Usage + +Add dependency, replacing `{{version}}` with the latest release version. + +**Maven:** + +```xml + + io.opentelemetry.contrib + opentelemetry-compressor-zstd + {{version}}/version> + +``` + +**Gradle:** + +```groovy +dependencies { + implementation "io.opentelemetry.contrib:opentelemetry-compressor-zstd:{{version}}" +} +``` + +If programmatically configuring the exporter: + +```java +// same pattern applies to OtlpHttpMetricExporter, OtlpHttpSpanExporter, and the gRPC variants +OtlpHttpLogRecordExporter.builder() + .setCompression("zstd") + // ...additional configuration omitted for brevity + .build() +``` + +If using [autoconfigure](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure): + +```shell +export OTEL_EXPORTER_OTLP_COMPRESSION=zstd +``` + +## Component owners + +- [Jack Berg](https://github.com/jack-berg), New Relic + +Learn more about component owners in [component_owners.yml](../.github/component_owners.yml). From 3889defba2fa27ffc7d3907c79ab0051090fbf76 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Fri, 5 Jan 2024 14:58:00 -0600 Subject: [PATCH 3/4] fix typo --- compressors/zstd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compressors/zstd/README.md b/compressors/zstd/README.md index dc969e4cc..128313d60 100644 --- a/compressors/zstd/README.md +++ b/compressors/zstd/README.md @@ -14,7 +14,7 @@ Add dependency, replacing `{{version}}` with the latest release version. io.opentelemetry.contrib opentelemetry-compressor-zstd - {{version}}/version> + {{version}} ``` From 6571cf3787a48b71aec5aebacfde844e8acee139 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Fri, 5 Jan 2024 17:08:01 -0600 Subject: [PATCH 4/4] PR feedback --- .../src/main/kotlin/otel.java-conventions.gradle.kts | 12 +++--------- compressors/build.gradle.kts | 10 ---------- compressors/{zstd => compressor-zstd}/README.md | 0 .../{zstd => compressor-zstd}/build.gradle.kts | 2 +- .../contrib/compressor/zstd/ZstdCompressor.java | 0 .../compressor/zstd/ZstdCompressorProvider.java | 0 ....exporter.internal.compression.CompressorProvider | 0 .../compressor/zstd/ZstdCompressorProviderTest.java | 0 .../contrib/compressor/zstd/ZstdCompressorTest.java | 0 settings.gradle.kts | 2 +- 10 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 compressors/build.gradle.kts rename compressors/{zstd => compressor-zstd}/README.md (100%) rename compressors/{zstd => compressor-zstd}/build.gradle.kts (83%) rename compressors/{zstd => compressor-zstd}/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java (100%) rename compressors/{zstd => compressor-zstd}/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java (100%) rename compressors/{zstd => compressor-zstd}/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider (100%) rename compressors/{zstd => compressor-zstd}/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java (100%) rename compressors/{zstd => compressor-zstd}/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java (100%) diff --git a/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts index 0663fffc3..ce5512713 100644 --- a/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts @@ -10,17 +10,11 @@ plugins { id("otel.spotless-conventions") } +val otelJava = extensions.create("otelJava") group = "io.opentelemetry.contrib" -base { - // May be set already by a parent project, only set if not. - if (!archivesName.get().startsWith("opentelemetry-")) { - archivesName.set("opentelemetry-$name") - } -} - -val otelJava = extensions.create("otelJava") +base.archivesName.set("opentelemetry-${project.name}") // Version to use to compile code and run tests. val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_17 @@ -28,7 +22,7 @@ val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_17 java { toolchain { languageVersion.set( - otelJava.minJavaVersionSupported.map { JavaLanguageVersion.of(Math.max(it.majorVersion.toInt(), DEFAULT_JAVA_VERSION.majorVersion.toInt())) } + otelJava.minJavaVersionSupported.map { JavaLanguageVersion.of(Math.max(it.majorVersion.toInt(), DEFAULT_JAVA_VERSION.majorVersion.toInt())) } ) } diff --git a/compressors/build.gradle.kts b/compressors/build.gradle.kts deleted file mode 100644 index eca03bdac..000000000 --- a/compressors/build.gradle.kts +++ /dev/null @@ -1,10 +0,0 @@ -subprojects { - // https://github.com/gradle/gradle/issues/847 - group = "io.opentelemetry.compressors" - val proj = this - plugins.withId("java") { - configure { - archivesName.set("opentelemetry-compressor-${proj.name}") - } - } -} diff --git a/compressors/zstd/README.md b/compressors/compressor-zstd/README.md similarity index 100% rename from compressors/zstd/README.md rename to compressors/compressor-zstd/README.md diff --git a/compressors/zstd/build.gradle.kts b/compressors/compressor-zstd/build.gradle.kts similarity index 83% rename from compressors/zstd/build.gradle.kts rename to compressors/compressor-zstd/build.gradle.kts index 0ab76cb45..f0d3b2d4b 100644 --- a/compressors/zstd/build.gradle.kts +++ b/compressors/compressor-zstd/build.gradle.kts @@ -7,7 +7,7 @@ description = "zstd compressor implementation for use with OTLP exporters" otelJava.moduleName.set("io.opentelemetry.contrib.compressor.zstd") dependencies { - // Use version from :depedencyManagement when opentelemetry-instrumentation-bom-alpha depends on opentelemetry-java 1.34.0 + // TODO(jack-berg): Use version from :depedencyManagement when opentelemetry-instrumentation-bom-alpha depends on opentelemetry-java 1.34.0 var openTelemetryVersion = "1.34.0" api("io.opentelemetry:opentelemetry-exporter-common:$openTelemetryVersion") diff --git a/compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java b/compressors/compressor-zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java similarity index 100% rename from compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java rename to compressors/compressor-zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressor.java diff --git a/compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java b/compressors/compressor-zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java similarity index 100% rename from compressors/zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java rename to compressors/compressor-zstd/src/main/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProvider.java diff --git a/compressors/zstd/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider b/compressors/compressor-zstd/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider similarity index 100% rename from compressors/zstd/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider rename to compressors/compressor-zstd/src/main/resources/META-INF/services/io.opentelemetry.exporter.internal.compression.CompressorProvider diff --git a/compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java b/compressors/compressor-zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java similarity index 100% rename from compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java rename to compressors/compressor-zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorProviderTest.java diff --git a/compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java b/compressors/compressor-zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java similarity index 100% rename from compressors/zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java rename to compressors/compressor-zstd/src/test/java/io/opentelemetry/contrib/compressor/zstd/ZstdCompressorTest.java diff --git a/settings.gradle.kts b/settings.gradle.kts index ebc900e2e..1c7889407 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -62,7 +62,7 @@ include(":all") include(":aws-resources") include(":aws-xray") include(":aws-xray-propagator") -include(":compressors:zstd") +include(":compressors:compressor-zstd") include(":consistent-sampling") include(":dependencyManagement") include(":disk-buffering")