Merge otlp exporters (#4499)
* Merge otlp http trace and metric exporters into :exporters:otlp:all * Merge otlp http exporter into :exporters:otlp:logs * Artifact descriptions
This commit is contained in:
parent
60cc5f452a
commit
92bd65970e
27
README.md
27
README.md
|
|
@ -248,21 +248,18 @@ dependency as follows, replacing `{{artifact-id}}` with the value from the "Arti
|
|||
|
||||
### SDK Exporters
|
||||
|
||||
| Component | Description | Artifact ID | Version |
|
||||
|-------------------------------------------------------------|-------------------------------------------------------------------------------------|--------------------------------------------|-------------------------------------------------------------|
|
||||
| [OTLP gRPC Exporter](./exporters/otlp/all) | OTLP gRPC exporters, including metrics and trace | `opentelemetry-exporter-otlp` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [OTLP gRPC Logs Exporter](./exporters/otlp/logs) | OTLP gRPC log exporter | `opentelemetry-exporter-otlp-logs` | <!--VERSION_UNSTABLE-->1.14.0-alpha<!--/VERSION_UNSTABLE--> |
|
||||
| [OTLP HTTP Trace Exporter](./exporters/otlp-http/trace) | OTLP http/protobuf trace exporter | `opentelemetry-exporter-otlp-http-trace` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [OTLP HTTP Metrics Exporter](./exporters/otlp-http/metrics) | OTLP http/protobuf metrics exporter | `opentelemetry-exporter-otlp-http-metrics` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [OTLP HTTP Logs Exporter](./exporters/otlp-http/logs) | OTLP http/protobuf logs exporter | `opentelemetry-exporter-otlp-http-logs` | <!--VERSION_UNSTABLE-->1.14.0-alpha<!--/VERSION_UNSTABLE--> |
|
||||
| [OTLP Common](./exporters/otlp/common) | Shared OTLP components (internal) | `opentelemetry-exporter-otlp-common` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Jaeger gRPC Exporter](./exporters/jaeger) | Jaeger gRPC trace exporter | `opentelemetry-exporter-jaeger` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Jaeger Thrift Exporter](./exporters/jaeger-thrift) | Jaeger thrift trace exporter | `opentelemetry-exporter-jaeger-thift` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Jaeger Proto](./exporters/jaeger-proto) | Jaeger gRPC protobuf definitions (deprecated) | `opentelemetry-exporter-jaeger-proto` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Logging Exporter](./exporters/logging) | Logging exporters, includings metrics, traces, and logs | `opentelemetry-exporter-logging` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [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.14.0<!--/VERSION_STABLE--> |
|
||||
| [Zipkin Exporter](./exporters/zipkin) | Zipkin trace exporter | `opentelemetry-exporter-zipkin` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Prometheus Exporter](./exporters/prometheus) | Prometheus metric exporter | `opentelemetry-exporter-prometheus` | <!--VERSION_UNSTABLE-->1.14.0-alpha<!--/VERSION_UNSTABLE--> |
|
||||
| Component | Description | Artifact ID | Version |
|
||||
|-----------------------------------------------------|-------------------------------------------------------------------------------------|---------------------------------------|-------------------------------------------------------------|
|
||||
| [OTLP Exporters](./exporters/otlp/all) | OTLP gRPC & HTTP exporters, including metrics and trace | `opentelemetry-exporter-otlp` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [OTLP Log Exporters](./exporters/otlp/logs) | OTLP gRPC & HTTP log exporters | `opentelemetry-exporter-otlp-logs` | <!--VERSION_UNSTABLE-->1.14.0-alpha<!--/VERSION_UNSTABLE--> |
|
||||
| [OTLP Common](./exporters/otlp/common) | Shared OTLP components (internal) | `opentelemetry-exporter-otlp-common` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Jaeger gRPC Exporter](./exporters/jaeger) | Jaeger gRPC trace exporter | `opentelemetry-exporter-jaeger` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Jaeger Thrift Exporter](./exporters/jaeger-thrift) | Jaeger thrift trace exporter | `opentelemetry-exporter-jaeger-thift` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Jaeger Proto](./exporters/jaeger-proto) | Jaeger gRPC protobuf definitions (deprecated) | `opentelemetry-exporter-jaeger-proto` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Logging Exporter](./exporters/logging) | Logging exporters, includings metrics, traces, and logs | `opentelemetry-exporter-logging` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [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.14.0<!--/VERSION_STABLE--> |
|
||||
| [Zipkin Exporter](./exporters/zipkin) | Zipkin trace exporter | `opentelemetry-exporter-zipkin` | <!--VERSION_STABLE-->1.14.0<!--/VERSION_STABLE--> |
|
||||
| [Prometheus Exporter](./exporters/prometheus) | Prometheus metric exporter | `opentelemetry-exporter-prometheus` | <!--VERSION_UNSTABLE-->1.14.0-alpha<!--/VERSION_UNSTABLE--> |
|
||||
|
||||
### SDK Extensions
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,45 @@
|
|||
Comparing source compatibility of against
|
||||
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter (not serializable)
|
||||
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
|
||||
+++ NEW SUPERCLASS: java.lang.Object
|
||||
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder builder()
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.common.CompletableResultCode export(java.util.Collection)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.common.CompletableResultCode flush()
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.metrics.data.AggregationTemporality getAggregationTemporality(io.opentelemetry.sdk.metrics.InstrumentType)
|
||||
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter getDefault()
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.common.CompletableResultCode shutdown()
|
||||
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder (not serializable)
|
||||
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
|
||||
+++ NEW SUPERCLASS: java.lang.Object
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder addHeader(java.lang.String, java.lang.String)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter build()
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setAggregationTemporalitySelector(io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setClientTls(byte[], byte[])
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setCompression(java.lang.String)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setEndpoint(java.lang.String)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setTimeout(long, java.util.concurrent.TimeUnit)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setTimeout(java.time.Duration)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporterBuilder setTrustedCertificates(byte[])
|
||||
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter (not serializable)
|
||||
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
|
||||
+++ NEW SUPERCLASS: java.lang.Object
|
||||
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder builder()
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.common.CompletableResultCode export(java.util.Collection)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.common.CompletableResultCode flush()
|
||||
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter getDefault()
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.common.CompletableResultCode shutdown()
|
||||
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder (not serializable)
|
||||
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
|
||||
+++ NEW SUPERCLASS: java.lang.Object
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder addHeader(java.lang.String, java.lang.String)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter build()
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setClientTls(byte[], byte[])
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setCompression(java.lang.String)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setEndpoint(java.lang.String)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setMeterProvider(io.opentelemetry.api.metrics.MeterProvider)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setTimeout(long, java.util.concurrent.TimeUnit)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setTimeout(java.time.Duration)
|
||||
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporterBuilder setTrustedCertificates(byte[])
|
||||
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter (not serializable)
|
||||
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
|
||||
+++ NEW SUPERCLASS: java.lang.Object
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
subprojects {
|
||||
// Workaround https://github.com/gradle/gradle/issues/847
|
||||
group = "io.opentelemetry.exporter.otlp.http"
|
||||
val proj = this
|
||||
plugins.withId("java") {
|
||||
configure<BasePluginExtension> {
|
||||
archivesName.set("opentelemetry-exporter-otlp-http-${proj.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
plugins {
|
||||
id("otel.java-conventions")
|
||||
id("otel.publish-conventions")
|
||||
|
||||
id("otel.animalsniffer-conventions")
|
||||
}
|
||||
|
||||
description = "OpenTelemetry Protocol HTTP Logs Exporter"
|
||||
otelJava.moduleName.set("io.opentelemetry.exporter.otlp.http.logs")
|
||||
|
||||
dependencies {
|
||||
api(project(":sdk:logs"))
|
||||
|
||||
implementation(project(":exporters:otlp:common"))
|
||||
|
||||
implementation("com.squareup.okhttp3:okhttp")
|
||||
|
||||
testImplementation(project(":sdk:testing"))
|
||||
|
||||
testImplementation("com.google.api.grpc:proto-google-common-protos")
|
||||
testImplementation("com.linecorp.armeria:armeria-junit5")
|
||||
testImplementation("com.squareup.okhttp3:okhttp-tls")
|
||||
testImplementation("io.opentelemetry.proto:opentelemetry-proto")
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
otel.release=alpha
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# OpenTelemetry - OTLP Metrics Exporter - HTTP
|
||||
|
||||
[![Javadocs][javadoc-image]][javadoc-url]
|
||||
|
||||
This is the OpenTelemetry exporter, sending metric data to OpenTelemetry collector via HTTP without gRPC.
|
||||
|
||||
[javadoc-image]: https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-otlp-http-metrics.svg
|
||||
[javadoc-url]: https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-otlp-http-metrics
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
plugins {
|
||||
id("otel.java-conventions")
|
||||
id("otel.publish-conventions")
|
||||
|
||||
id("otel.animalsniffer-conventions")
|
||||
}
|
||||
|
||||
description = "OpenTelemetry Protocol HTTP Metrics Exporter"
|
||||
otelJava.moduleName.set("io.opentelemetry.exporter.otlp.http.metrics")
|
||||
|
||||
dependencies {
|
||||
api(project(":sdk:metrics"))
|
||||
|
||||
implementation(project(":exporters:otlp:common"))
|
||||
|
||||
implementation("com.squareup.okhttp3:okhttp")
|
||||
|
||||
testImplementation(project(":sdk:testing"))
|
||||
|
||||
testImplementation("com.google.api.grpc:proto-google-common-protos")
|
||||
testImplementation("com.linecorp.armeria:armeria-junit5")
|
||||
testImplementation("com.squareup.okhttp3:okhttp-tls")
|
||||
testImplementation("io.opentelemetry.proto:opentelemetry-proto")
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# OpenTelemetry - OTLP Trace Exporter - HTTP
|
||||
|
||||
[![Javadocs][javadoc-image]][javadoc-url]
|
||||
|
||||
This is the OpenTelemetry exporter, sending span data to OpenTelemetry collector via HTTP without gRPC.
|
||||
|
||||
[javadoc-image]: https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-exporter-otlp-http-trace.svg
|
||||
[javadoc-url]: https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-otlp-http-trace
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
plugins {
|
||||
id("otel.java-conventions")
|
||||
id("otel.publish-conventions")
|
||||
|
||||
id("otel.animalsniffer-conventions")
|
||||
}
|
||||
|
||||
description = "OpenTelemetry Protocol HTTP Trace Exporter"
|
||||
otelJava.moduleName.set("io.opentelemetry.exporter.otlp.http.trace")
|
||||
|
||||
dependencies {
|
||||
api(project(":sdk:trace"))
|
||||
|
||||
implementation(project(":exporters:otlp:common"))
|
||||
|
||||
implementation("com.squareup.okhttp3:okhttp")
|
||||
|
||||
testImplementation(project(":sdk:testing"))
|
||||
|
||||
testImplementation("com.google.api.grpc:proto-google-common-protos")
|
||||
testImplementation("com.linecorp.armeria:armeria-junit5")
|
||||
testImplementation("com.squareup.okhttp3:okhttp-tls")
|
||||
testImplementation("io.opentelemetry.proto:opentelemetry-proto")
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ plugins {
|
|||
id("otel.animalsniffer-conventions")
|
||||
}
|
||||
|
||||
description = "OpenTelemetry Protocol gRPC Exporters"
|
||||
description = "OpenTelemetry Protocol (OTLP) Exporters"
|
||||
otelJava.moduleName.set("io.opentelemetry.exporter.otlp")
|
||||
base.archivesName.set("opentelemetry-exporter-otlp")
|
||||
|
||||
|
|
@ -19,6 +19,9 @@ dependencies {
|
|||
compileOnly("io.grpc:grpc-stub")
|
||||
|
||||
testImplementation(project(":exporters:otlp:testing-internal"))
|
||||
testImplementation("com.linecorp.armeria:armeria-junit5")
|
||||
testImplementation("com.google.api.grpc:proto-google-common-protos")
|
||||
testImplementation("com.squareup.okhttp3:okhttp-tls")
|
||||
|
||||
jmhImplementation(project(":sdk:testing"))
|
||||
jmhImplementation("com.linecorp.armeria:armeria")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ plugins {
|
|||
id("otel.animalsniffer-conventions")
|
||||
}
|
||||
|
||||
description = "OpenTelemetry Protocol Logs Exporter"
|
||||
description = "OpenTelemetry Protocol (OTLP) Log Exporters"
|
||||
otelJava.moduleName.set("io.opentelemetry.exporter.otlp.logs")
|
||||
|
||||
dependencies {
|
||||
|
|
@ -16,6 +16,10 @@ dependencies {
|
|||
compileOnly("io.grpc:grpc-stub")
|
||||
|
||||
testImplementation(project(":exporters:otlp:testing-internal"))
|
||||
|
||||
testImplementation("com.linecorp.armeria:armeria-junit5")
|
||||
testImplementation("com.google.api.grpc:proto-google-common-protos")
|
||||
testImplementation("com.squareup.okhttp3:okhttp-tls")
|
||||
}
|
||||
|
||||
testing {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@ dependencies {
|
|||
|
||||
implementation(project(":exporters:otlp:all"))
|
||||
implementation(project(":exporters:otlp:logs"))
|
||||
implementation(project(":exporters:otlp-http:logs"))
|
||||
implementation(project(":exporters:otlp-http:metrics"))
|
||||
implementation(project(":exporters:otlp-http:trace"))
|
||||
implementation(project(":semconv"))
|
||||
|
||||
implementation("com.linecorp.armeria:armeria-grpc-protocol")
|
||||
|
|
|
|||
|
|
@ -19,9 +19,6 @@ dependencies {
|
|||
compileOnly(project(":exporters:otlp:all"))
|
||||
compileOnly(project(":exporters:otlp:logs"))
|
||||
compileOnly(project(":exporters:otlp:common"))
|
||||
compileOnly(project(":exporters:otlp-http:trace"))
|
||||
compileOnly(project(":exporters:otlp-http:metrics"))
|
||||
compileOnly(project(":exporters:otlp-http:logs"))
|
||||
compileOnly(project(":exporters:prometheus"))
|
||||
compileOnly(project(":exporters:zipkin"))
|
||||
|
||||
|
|
@ -118,7 +115,7 @@ testing {
|
|||
}
|
||||
}
|
||||
}
|
||||
val testOtlpGrpc by registering(JvmTestSuite::class) {
|
||||
val testOtlp by registering(JvmTestSuite::class) {
|
||||
dependencies {
|
||||
implementation(project(":exporters:otlp:all"))
|
||||
implementation(project(":exporters:otlp:logs"))
|
||||
|
|
@ -128,22 +125,9 @@ testing {
|
|||
implementation("io.opentelemetry.proto:opentelemetry-proto")
|
||||
implementation("com.linecorp.armeria:armeria-junit5")
|
||||
implementation("com.linecorp.armeria:armeria-grpc")
|
||||
runtimeOnly("io.grpc:grpc-netty-shaded")
|
||||
}
|
||||
}
|
||||
val testOtlpHttp by registering(JvmTestSuite::class) {
|
||||
dependencies {
|
||||
implementation(project(":exporters:otlp-http:trace"))
|
||||
implementation(project(":exporters:otlp-http:metrics"))
|
||||
implementation(project(":exporters:otlp-http:logs"))
|
||||
implementation(project(":exporters:otlp:common"))
|
||||
implementation(project(":sdk:testing"))
|
||||
|
||||
implementation("com.google.guava:guava")
|
||||
implementation("com.linecorp.armeria:armeria-junit5")
|
||||
implementation("com.squareup.okhttp3:okhttp")
|
||||
implementation("com.squareup.okhttp3:okhttp-tls")
|
||||
implementation("io.opentelemetry.proto:opentelemetry-proto")
|
||||
runtimeOnly("io.grpc:grpc-netty-shaded")
|
||||
}
|
||||
}
|
||||
val testPrometheus by registering(JvmTestSuite::class) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.google.common.collect.Lists;
|
|||
import com.linecorp.armeria.testing.junit5.server.SelfSignedCertificateExtension;
|
||||
import io.opentelemetry.api.GlobalOpenTelemetry;
|
||||
import io.opentelemetry.api.metrics.MeterProvider;
|
||||
import io.opentelemetry.sdk.OpenTelemetrySdk;
|
||||
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
|
||||
import io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException;
|
||||
import io.opentelemetry.sdk.logs.data.LogData;
|
||||
|
|
@ -26,6 +27,7 @@ import io.opentelemetry.sdk.metrics.data.MetricData;
|
|||
import io.opentelemetry.sdk.metrics.export.MetricExporter;
|
||||
import io.opentelemetry.sdk.trace.data.SpanData;
|
||||
import io.opentelemetry.sdk.trace.export.SpanExporter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -60,6 +62,7 @@ class OtlpGrpcConfigTest {
|
|||
@AfterEach
|
||||
public void tearDown() {
|
||||
server.reset();
|
||||
shutdownGlobalSdk();
|
||||
GlobalOpenTelemetry.resetForTest();
|
||||
}
|
||||
|
||||
|
|
@ -324,4 +327,29 @@ class OtlpGrpcConfigTest {
|
|||
assertThat(server.metricRequests).isNotEmpty();
|
||||
});
|
||||
}
|
||||
|
||||
static void shutdownGlobalSdk() {
|
||||
try {
|
||||
Field globalOpenTelemetryField =
|
||||
GlobalOpenTelemetry.class.getDeclaredField("globalOpenTelemetry");
|
||||
globalOpenTelemetryField.setAccessible(true);
|
||||
Object globalOpenTelemetry = globalOpenTelemetryField.get(null);
|
||||
if (globalOpenTelemetry == null) {
|
||||
return;
|
||||
}
|
||||
Field delegateField =
|
||||
Class.forName("io.opentelemetry.api.GlobalOpenTelemetry$ObfuscatedOpenTelemetry")
|
||||
.getDeclaredField("delegate");
|
||||
delegateField.setAccessible(true);
|
||||
Object delegate = delegateField.get(globalOpenTelemetry);
|
||||
if (delegate instanceof OpenTelemetrySdk) {
|
||||
OpenTelemetrySdk sdk = ((OpenTelemetrySdk) delegate);
|
||||
sdk.getSdkTracerProvider().shutdown().join(10, TimeUnit.SECONDS);
|
||||
sdk.getSdkMeterProvider().shutdown().join(10, TimeUnit.SECONDS);
|
||||
sdk.getSdkLogEmitterProvider().shutdown().join(10, TimeUnit.SECONDS);
|
||||
}
|
||||
} catch (NoSuchFieldException | IllegalAccessException | ClassNotFoundException e) {
|
||||
throw new IllegalStateException("Error shutting down global SDK.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package io.opentelemetry.sdk.autoconfigure;
|
||||
|
||||
import static io.opentelemetry.sdk.autoconfigure.OtlpGrpcConfigTest.shutdownGlobalSdk;
|
||||
import static io.opentelemetry.sdk.autoconfigure.OtlpHttpServerExtension.generateFakeLog;
|
||||
import static io.opentelemetry.sdk.autoconfigure.OtlpHttpServerExtension.generateFakeMetric;
|
||||
import static io.opentelemetry.sdk.autoconfigure.OtlpHttpServerExtension.generateFakeSpan;
|
||||
|
|
@ -47,6 +48,7 @@ class OtlpHttpConfigTest {
|
|||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
shutdownGlobalSdk();
|
||||
GlobalOpenTelemetry.resetForTest();
|
||||
}
|
||||
|
||||
|
|
@ -42,9 +42,6 @@ include(":exporters:otlp:all")
|
|||
include(":exporters:otlp:common")
|
||||
include(":exporters:otlp:logs")
|
||||
include(":exporters:otlp:testing-internal")
|
||||
include(":exporters:otlp-http:logs")
|
||||
include(":exporters:otlp-http:metrics")
|
||||
include(":exporters:otlp-http:trace")
|
||||
include(":exporters:prometheus")
|
||||
include(":exporters:zipkin")
|
||||
include(":integration-tests")
|
||||
|
|
|
|||
Loading…
Reference in New Issue