diff --git a/api/all/src/main/resources/META-INF/native-image/io.opentelemetry/opentelemetry-api/reflect-config.json b/api/all/src/main/resources/META-INF/native-image/io.opentelemetry/opentelemetry-api/reflect-config.json deleted file mode 100644 index a8c57fbdb83..00000000000 --- a/api/all/src/main/resources/META-INF/native-image/io.opentelemetry/opentelemetry-api/reflect-config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern":"\\Qio/opentelemetry/api/version.properties\\E" - } - ] - }, - "bundles": [] -} diff --git a/integration-tests/graal/build.gradle.kts b/integration-tests/graal/build.gradle.kts index cb39297a76a..090be76a2f5 100644 --- a/integration-tests/graal/build.gradle.kts +++ b/integration-tests/graal/build.gradle.kts @@ -16,7 +16,9 @@ sourceSets { } dependencies { - implementation(project(path = ":sdk:trace-shaded-deps")) + implementation(project(":sdk:all")) + implementation(project(":sdk:trace-shaded-deps")) + implementation(project(":exporters:otlp:all")) } // org.graalvm.buildtools.native pluging requires java 11+ as of version 0.9.26 diff --git a/integration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/InitializeSdkTest.java b/integration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/InitializeSdkTest.java new file mode 100644 index 00000000000..8826db405de --- /dev/null +++ b/integration-tests/graal/src/test/java/io/opentelemetry/integrationtests/graal/InitializeSdkTest.java @@ -0,0 +1,53 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.integrationtests.graal; + +import static org.assertj.core.api.Assertions.assertThatCode; + +import io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporter; +import io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter; +import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.logs.SdkLoggerProvider; +import io.opentelemetry.sdk.logs.export.BatchLogRecordProcessor; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; +import org.junit.jupiter.api.Test; + +class InitializeSdkTest { + + @Test + void initializeSdk() { + assertThatCode( + () -> { + OpenTelemetrySdk sdk = + OpenTelemetrySdk.builder() + .setTracerProvider( + SdkTracerProvider.builder() + .addSpanProcessor( + BatchSpanProcessor.builder(OtlpGrpcSpanExporter.getDefault()) + .build()) + .build()) + .setMeterProvider( + SdkMeterProvider.builder() + .registerMetricReader( + PeriodicMetricReader.create(OtlpGrpcMetricExporter.getDefault())) + .build()) + .setLoggerProvider( + SdkLoggerProvider.builder() + .addLogRecordProcessor( + BatchLogRecordProcessor.builder( + OtlpGrpcLogRecordExporter.getDefault()) + .build()) + .build()) + .build(); + sdk.close(); + }) + .doesNotThrowAnyException(); + } +}