diff --git a/instrumentation/micrometer/micrometer-1.5/library/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/Bridging.java b/instrumentation/micrometer/micrometer-1.5/library/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/Bridging.java index 8ff9abd223ea..9555a2b67a47 100644 --- a/instrumentation/micrometer/micrometer-1.5/library/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/Bridging.java +++ b/instrumentation/micrometer/micrometer-1.5/library/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/Bridging.java @@ -47,7 +47,7 @@ static String description(Meter.Id id) { static String baseUnit(Meter.Id id) { String baseUnit = id.getBaseUnit(); - return baseUnit == null ? "1" : baseUnit; + return baseUnit == null ? "" : baseUnit; } static String statisticInstrumentName( diff --git a/instrumentation/micrometer/micrometer-1.5/library/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/OpenTelemetryFunctionTimer.java b/instrumentation/micrometer/micrometer-1.5/library/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/OpenTelemetryFunctionTimer.java index 91fb153f577a..fb238fb23a8e 100644 --- a/instrumentation/micrometer/micrometer-1.5/library/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/OpenTelemetryFunctionTimer.java +++ b/instrumentation/micrometer/micrometer-1.5/library/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/OpenTelemetryFunctionTimer.java @@ -44,7 +44,7 @@ final class OpenTelemetryFunctionTimer extends AbstractMeter otelMeter .counterBuilder(name + ".count") .setDescription(Bridging.description(id)) - .setUnit("1") + .setUnit("{invocation}") .buildWithCallback(new LongMeasurementRecorder<>(obj, countFunction, attributes)); this.observableTotalTime = diff --git a/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractFunctionTimerMillisecondsTest.java b/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractFunctionTimerMillisecondsTest.java index c39d16adb92a..fa1bd06ed49b 100644 --- a/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractFunctionTimerMillisecondsTest.java +++ b/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractFunctionTimerMillisecondsTest.java @@ -56,7 +56,7 @@ void testFunctionTimerWithBaseUnitMilliseconds() { metric -> assertThat(metric) .hasDescription("This is a test function timer") - .hasUnit("1") + .hasUnit("{invocation}") .hasLongSumSatisfying( sum -> sum.isMonotonic() diff --git a/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractFunctionTimerTest.java b/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractFunctionTimerTest.java index 9d1156e33637..d0cff95338ce 100644 --- a/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractFunctionTimerTest.java +++ b/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractFunctionTimerTest.java @@ -59,7 +59,7 @@ void testFunctionTimer() { metric -> assertThat(metric) .hasDescription("This is a test function timer") - .hasUnit("1") + .hasUnit("{invocation}") .hasLongSumSatisfying( sum -> sum.isMonotonic() diff --git a/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractPrometheusModeTest.java b/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractPrometheusModeTest.java index 7bb782e10a76..2666a1308812 100644 --- a/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractPrometheusModeTest.java +++ b/instrumentation/micrometer/micrometer-1.5/testing/src/main/java/io/opentelemetry/instrumentation/micrometer/v1_5/AbstractPrometheusModeTest.java @@ -140,7 +140,7 @@ void testFunctionTimer() { metric -> assertThat(metric) .hasDescription("This is a test function timer") - .hasUnit("1") + .hasUnit("{invocation}") .hasLongSumSatisfying( sum -> sum.isMonotonic() diff --git a/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Classes.java b/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Classes.java index 2695d5927cee..b9e4b891e7a9 100644 --- a/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Classes.java +++ b/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Classes.java @@ -48,7 +48,7 @@ List registerObservers(OpenTelemetry openTelemetry, ClassLoadingM meter .counterBuilder("process.runtime.jvm.classes.loaded") .setDescription("Number of classes loaded since JVM start") - .setUnit("1") + .setUnit("{class}") .buildWithCallback( observableMeasurement -> observableMeasurement.record(classBean.getTotalLoadedClassCount()))); @@ -57,7 +57,7 @@ List registerObservers(OpenTelemetry openTelemetry, ClassLoadingM meter .counterBuilder("process.runtime.jvm.classes.unloaded") .setDescription("Number of classes unloaded since JVM start") - .setUnit("1") + .setUnit("{class}") .buildWithCallback( observableMeasurement -> observableMeasurement.record(classBean.getUnloadedClassCount()))); @@ -65,7 +65,7 @@ List registerObservers(OpenTelemetry openTelemetry, ClassLoadingM meter .upDownCounterBuilder("process.runtime.jvm.classes.current_loaded") .setDescription("Number of classes currently loaded") - .setUnit("1") + .setUnit("{class}") .buildWithCallback( observableMeasurement -> observableMeasurement.record(classBean.getLoadedClassCount()))); diff --git a/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Threads.java b/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Threads.java index 28f61edaba0c..5cc38d422187 100644 --- a/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Threads.java +++ b/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/Threads.java @@ -51,7 +51,7 @@ List registerObservers(OpenTelemetry openTelemetry, ThreadMXBean meter .upDownCounterBuilder("process.runtime.jvm.threads.count") .setDescription("Number of executing threads") - .setUnit("1") + .setUnit("{thread}") .buildWithCallback( observableMeasurement -> { observableMeasurement.record( diff --git a/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/ClassesTest.java b/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/ClassesTest.java index accdc46270d5..7ccdd31f3f75 100644 --- a/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/ClassesTest.java +++ b/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/ClassesTest.java @@ -44,7 +44,7 @@ void registerObservers() { assertThat(metricData) .hasInstrumentationScope(EXPECTED_SCOPE) .hasDescription("Number of classes loaded since JVM start") - .hasUnit("1") + .hasUnit("{class}") .hasLongSumSatisfying( sum -> sum.isMonotonic() @@ -60,7 +60,7 @@ void registerObservers() { assertThat(metricData) .hasInstrumentationScope(EXPECTED_SCOPE) .hasDescription("Number of classes unloaded since JVM start") - .hasUnit("1") + .hasUnit("{class}") .hasLongSumSatisfying( sum -> sum.isMonotonic() @@ -76,7 +76,7 @@ void registerObservers() { assertThat(metricData) .hasInstrumentationScope(EXPECTED_SCOPE) .hasDescription("Number of classes currently loaded") - .hasUnit("1") + .hasUnit("{class}") .hasLongSumSatisfying( sum -> sum.isNotMonotonic() diff --git a/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/ThreadsTest.java b/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/ThreadsTest.java index da2c70d13710..3fd7455c3f91 100644 --- a/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/ThreadsTest.java +++ b/instrumentation/runtime-metrics/runtime-metrics-java8/library/src/test/java/io/opentelemetry/instrumentation/runtimemetrics/java8/ThreadsTest.java @@ -44,7 +44,7 @@ void registerObservers() { assertThat(metricData) .hasInstrumentationScope(EXPECTED_SCOPE) .hasDescription("Number of executing threads") - .hasUnit("1") + .hasUnit("{thread}") .hasLongSumSatisfying( sum -> sum.isNotMonotonic()