From ff73e9577c1c9be4a479c9d414f1805bec53f9d0 Mon Sep 17 00:00:00 2001 From: Jean Bisutti Date: Wed, 8 Mar 2023 16:58:37 +0100 Subject: [PATCH] Make the OpenTelemetry Logback appender work with GraalVM native images (#7989) I have tried the [OpenTelemetry Logback appender](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/logback/logback-appender-1.0/library) with GraalVM native images. The GraalVM configurations of this PR are required to make it work. It's my first GraalVM-related PR in this repo. In future works, adding automatic tests with GraalVM on some [programmatic instrumentation libraries](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md#libraries--frameworks) may be interesting. --- .../opentelemetry-instrumentation-api/native-image.properties | 2 ++ .../opentelemetry-jdbc/native-image.properties | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 instrumentation-api/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-instrumentation-api/native-image.properties create mode 100644 instrumentation/logback/logback-appender-1.0/library/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-jdbc/native-image.properties diff --git a/instrumentation-api/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-instrumentation-api/native-image.properties b/instrumentation-api/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-instrumentation-api/native-image.properties new file mode 100644 index 000000000000..758891265640 --- /dev/null +++ b/instrumentation-api/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-instrumentation-api/native-image.properties @@ -0,0 +1,2 @@ +Args=\ + --initialize-at-build-time=io.opentelemetry.instrumentation.api.internal.cache.concurrentlinkedhashmap.ConcurrentLinkedHashMap diff --git a/instrumentation/logback/logback-appender-1.0/library/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-jdbc/native-image.properties b/instrumentation/logback/logback-appender-1.0/library/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-jdbc/native-image.properties new file mode 100644 index 000000000000..e393b0676ffb --- /dev/null +++ b/instrumentation/logback/logback-appender-1.0/library/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-jdbc/native-image.properties @@ -0,0 +1,2 @@ +Args=\ + --initialize-at-build-time=io.opentelemetry.instrumentation.logback.appender.v1_0.internal.LoggingEventMapper