Skip to content

Commit f623564

Browse files
authored
Make the OTel starter work with GraalVM native 22 and 23 (#13500)
1 parent bbe1865 commit f623564

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.github/workflows/reusable-native-tests.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ jobs:
1717
graalvm-native-tests:
1818
if: "!inputs.skip-native-tests"
1919
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
test-java-version:
23+
- 22
24+
- 23
2025
steps:
2126
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2227
- id: read-java
2328
run: echo "version=$(cat .java-version)" >> "$GITHUB_OUTPUT"
2429
- uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # v1.3.3.1
2530
with:
2631
version: "latest"
27-
java-version: "${{ steps.read-java.outputs.version }}"
32+
java-version: ${{ matrix.test-java-version }}
2833
components: "native-image"
2934
- name: Running test
3035
env:

instrumentation-api/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-instrumentation-api/native-image.properties

-4
This file was deleted.

instrumentation/logback/logback-appender-1.0/library/src/main/resources/META-INF/native-image/io.opentelemetry.instrumentation/opentelemetry-logback-appender-1.0/native-image.properties

-2
This file was deleted.

smoke-tests-otel-starter/spring-boot-common/src/main/java/io/opentelemetry/spring/smoketest/AbstractOtelSpringStarterSmokeTest.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,13 @@ void shouldSendTelemetry() {
214214

215215
// JMX based metrics - test one per JMX bean
216216
List<String> jmxMetrics =
217-
new ArrayList<>(
218-
Arrays.asList(
219-
"jvm.thread.count",
220-
"jvm.memory.used",
221-
"jvm.system.cpu.load_1m",
222-
"jvm.memory.init"));
217+
new ArrayList<>(Arrays.asList("jvm.thread.count", "jvm.memory.used", "jvm.memory.init"));
218+
219+
double javaVersion = Double.parseDouble(System.getProperty("java.specification.version"));
220+
// See https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/13503
221+
if (javaVersion < 23) {
222+
jmxMetrics.add("jvm.system.cpu.load_1m");
223+
}
223224

224225
boolean noNative = System.getProperty("org.graalvm.nativeimage.imagecode") == null;
225226
if (noNative) {

0 commit comments

Comments
 (0)