Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace "1" with the appropriate units #8668

Merged
merged 9 commits into from
Jun 14, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -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;
zeitlinger marked this conversation as resolved.
Show resolved Hide resolved
}

static String statisticInstrumentName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class OpenTelemetryFunctionTimer<T> extends AbstractMeter
otelMeter
.counterBuilder(name + ".count")
.setDescription(Bridging.description(id))
.setUnit("1")
.setUnit("{invocations}")
zeitlinger marked this conversation as resolved.
Show resolved Hide resolved
.buildWithCallback(new LongMeasurementRecorder<>(obj, countFunction, attributes));

this.observableTotalTime =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ List<AutoCloseable> 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())));
Expand All @@ -57,15 +57,15 @@ List<AutoCloseable> 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())));
observables.add(
meter
.upDownCounterBuilder("process.runtime.jvm.classes.current_loaded")
.setDescription("Number of classes currently loaded")
.setUnit("1")
.setUnit("{class}")
.buildWithCallback(
observableMeasurement ->
observableMeasurement.record(classBean.getLoadedClassCount())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ List<AutoCloseable> 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("{core}")
zeitlinger marked this conversation as resolved.
Show resolved Hide resolved
.buildWithCallback(
observableMeasurement -> {
double loadAverage = osBean.getSystemLoadAverage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ List<AutoCloseable> registerObservers(OpenTelemetry openTelemetry, ThreadMXBean
meter
.upDownCounterBuilder("process.runtime.jvm.threads.count")
.setDescription("Number of executing threads")
.setUnit("1")
.setUnit("{thread}")
.buildWithCallback(
observableMeasurement -> {
observableMeasurement.record(
Expand Down