diff --git a/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/internal/ExperimentalFileDescriptor.java b/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/internal/ExperimentalFileDescriptor.java index 952958892796..72ac9939eafc 100644 --- a/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/internal/ExperimentalFileDescriptor.java +++ b/instrumentation/runtime-telemetry/runtime-telemetry-java8/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java8/internal/ExperimentalFileDescriptor.java @@ -12,10 +12,10 @@ import java.util.function.Supplier; /** - * Registers measurements that generate experimental metrics about file descriptor. This metrics are + * Registers measurements that generate experimental metrics about file descriptor. These metrics are * experimental, see File Descriptor metrics - * semantic conventions + * semantic conventions. * *

This class is internal and is hence not for public use. Its APIs are unstable and can change * at any time. @@ -46,7 +46,7 @@ static List registerObservers( .buildWithCallback( observableMeasurement -> { Long openCount = openFileDescriptorCount.get(); - if (openCount != null && openCount >= 0) { + if (openCount != null && openCount > 0) { observableMeasurement.record(openCount); } })); @@ -61,7 +61,7 @@ static List registerObservers( .buildWithCallback( observableMeasurement -> { Long maxCount = maxFileDescriptorCount.get(); - if (maxCount != null && maxCount >= 0) { + if (maxCount != null && maxCount > 0) { observableMeasurement.record(maxCount); } }));