From 0efa8ce32ecc52a6f3c3e6f7a168722458989d89 Mon Sep 17 00:00:00 2001 From: gregor Date: Tue, 20 Jun 2023 19:50:19 +0200 Subject: [PATCH 1/2] set cpu load unit to "{run_queue_item}" to match https://github.com/open-telemetry/semantic-conventions/pull/95 --- .../opentelemetry/instrumentation/runtimemetrics/java8/Cpu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Cpu.java b/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Cpu.java index edfd443fd6f7..555f66fb40cf 100644 --- a/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Cpu.java +++ b/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Cpu.java @@ -89,7 +89,7 @@ List registerObservers( meter .gaugeBuilder("process.runtime.jvm.system.cpu.load_1m") .setDescription("Average CPU load of the whole system for the last minute") - .setUnit("1") + .setUnit("{run_queue_item}") .buildWithCallback( observableMeasurement -> { double loadAverage = osBean.getSystemLoadAverage(); From 0eb0e836cf55448f10d51816a45d9bebbe982b7c Mon Sep 17 00:00:00 2001 From: gregor Date: Tue, 20 Jun 2023 19:51:49 +0200 Subject: [PATCH 2/2] set cpu load unit to "{run_queue_item}" to match https://github.com/open-telemetry/semantic-conventions/pull/95 --- .../instrumentation/runtimemetrics/java8/CpuTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/CpuTest.java b/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/CpuTest.java index 38f53768c0fb..17e88913ea4c 100644 --- a/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/CpuTest.java +++ b/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/CpuTest.java @@ -45,7 +45,7 @@ void registerObservers() { assertThat(metricData) .hasInstrumentationScope(EXPECTED_SCOPE) .hasDescription("Average CPU load of the whole system for the last minute") - .hasUnit("1") + .hasUnit("{run_queue_item}") .hasDoubleGaugeSatisfying( gauge -> gauge.hasPointsSatisfying(point -> point.hasValue(2.2))))); testing.waitAndAssertMetrics(