Fix some gauge types (#4962)
This commit is contained in:
parent
0fd7b8baa0
commit
a9aee8ed45
|
@ -28,8 +28,7 @@ public class ProcessMetrics {
|
|||
OSProcess processInfo = osInfo.getProcess(osInfo.getProcessId());
|
||||
|
||||
meter
|
||||
.gaugeBuilder("runtime.java.memory")
|
||||
.ofLongs()
|
||||
.upDownCounterBuilder("runtime.java.memory")
|
||||
.setDescription("Runtime Java memory")
|
||||
.setUnit("bytes")
|
||||
.buildWithCallback(
|
||||
|
|
|
@ -36,8 +36,7 @@ public class SystemMetrics {
|
|||
HardwareAbstractionLayer hal = systemInfo.getHardware();
|
||||
|
||||
meter
|
||||
.gaugeBuilder("system.memory.usage")
|
||||
.ofLongs()
|
||||
.upDownCounterBuilder("system.memory.usage")
|
||||
.setDescription("System memory usage")
|
||||
.setUnit("By")
|
||||
.buildWithCallback(
|
||||
|
@ -61,8 +60,7 @@ public class SystemMetrics {
|
|||
});
|
||||
|
||||
meter
|
||||
.gaugeBuilder("system.network.io")
|
||||
.ofLongs()
|
||||
.counterBuilder("system.network.io")
|
||||
.setDescription("System network IO")
|
||||
.setUnit("By")
|
||||
.buildWithCallback(
|
||||
|
@ -78,8 +76,7 @@ public class SystemMetrics {
|
|||
});
|
||||
|
||||
meter
|
||||
.gaugeBuilder("system.network.packets")
|
||||
.ofLongs()
|
||||
.counterBuilder("system.network.packets")
|
||||
.setDescription("System network packets")
|
||||
.setUnit("packets")
|
||||
.buildWithCallback(
|
||||
|
@ -95,8 +92,7 @@ public class SystemMetrics {
|
|||
});
|
||||
|
||||
meter
|
||||
.gaugeBuilder("system.network.errors")
|
||||
.ofLongs()
|
||||
.counterBuilder("system.network.errors")
|
||||
.setDescription("System network errors")
|
||||
.setUnit("errors")
|
||||
.buildWithCallback(
|
||||
|
@ -112,8 +108,7 @@ public class SystemMetrics {
|
|||
});
|
||||
|
||||
meter
|
||||
.gaugeBuilder("system.disk.io")
|
||||
.ofLongs()
|
||||
.counterBuilder("system.disk.io")
|
||||
.setDescription("System disk IO")
|
||||
.setUnit("By")
|
||||
.buildWithCallback(
|
||||
|
@ -128,8 +123,7 @@ public class SystemMetrics {
|
|||
});
|
||||
|
||||
meter
|
||||
.gaugeBuilder("system.disk.operations")
|
||||
.ofLongs()
|
||||
.counterBuilder("system.disk.operations")
|
||||
.setDescription("System disk operations")
|
||||
.setUnit("operations")
|
||||
.buildWithCallback(
|
||||
|
|
|
@ -20,7 +20,7 @@ public class ProcessMetricsTest extends AbstractMetricsTest {
|
|||
metric
|
||||
.hasName("runtime.java.memory")
|
||||
.hasUnit("bytes")
|
||||
.hasLongGauge()
|
||||
.hasLongSum()
|
||||
.points()
|
||||
.anySatisfy(point -> assertThat(point.getValue()).isPositive()),
|
||||
metric ->
|
||||
|
|
|
@ -20,7 +20,7 @@ public class SystemMetricsTest extends AbstractMetricsTest {
|
|||
metric
|
||||
.hasName("system.memory.usage")
|
||||
.hasUnit("By")
|
||||
.hasLongGauge()
|
||||
.hasLongSum()
|
||||
.points()
|
||||
.anySatisfy(point -> assertThat(point.getValue()).isPositive()),
|
||||
metric ->
|
||||
|
@ -30,9 +30,9 @@ public class SystemMetricsTest extends AbstractMetricsTest {
|
|||
.hasDoubleGauge()
|
||||
.points()
|
||||
.anySatisfy(point -> assertThat(point.getValue()).isPositive()),
|
||||
metric -> metric.hasName("system.network.io").hasUnit("By").hasLongGauge(),
|
||||
metric -> metric.hasName("system.network.packets").hasUnit("packets").hasLongGauge(),
|
||||
metric -> metric.hasName("system.network.errors").hasUnit("errors").hasLongGauge(),
|
||||
metric -> metric.hasName("system.disk.operations").hasUnit("operations").hasLongGauge());
|
||||
metric -> metric.hasName("system.network.io").hasUnit("By").hasLongSum(),
|
||||
metric -> metric.hasName("system.network.packets").hasUnit("packets").hasLongSum(),
|
||||
metric -> metric.hasName("system.network.errors").hasUnit("errors").hasLongSum(),
|
||||
metric -> metric.hasName("system.disk.operations").hasUnit("operations").hasLongSum());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,8 +63,7 @@ public final class MemoryPools {
|
|||
MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
|
||||
Meter meter = GlobalOpenTelemetry.get().getMeterProvider().get(MemoryPools.class.getName());
|
||||
meter
|
||||
.gaugeBuilder("runtime.jvm.memory.area")
|
||||
.ofLongs()
|
||||
.upDownCounterBuilder("runtime.jvm.memory.area")
|
||||
.setDescription("Bytes of a given JVM memory area.")
|
||||
.setUnit("By")
|
||||
.buildWithCallback(
|
||||
|
@ -88,8 +87,7 @@ public final class MemoryPools {
|
|||
maxLabelSets.add(Attributes.of(TYPE_KEY, MAX, POOL_KEY, pool.getName()));
|
||||
}
|
||||
meter
|
||||
.gaugeBuilder("runtime.jvm.memory.pool")
|
||||
.ofLongs()
|
||||
.upDownCounterBuilder("runtime.jvm.memory.pool")
|
||||
.setDescription("Bytes of a given JVM memory pool.")
|
||||
.setUnit("By")
|
||||
.buildWithCallback(
|
||||
|
|
Loading…
Reference in New Issue