Module io.prometheus.metrics.core
Class GaugeWithCallback
Object
Metric
MetricWithFixedMetadata
GaugeWithCallback
- All Implemented Interfaces:
Collector
Example:
MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
GaugeWithCallback.builder()
.name("jvm_memory_bytes_used")
.help("Used bytes of a given JVM memory area.")
.unit(Unit.BYTES)
.labelNames("area")
.callback(callback -> {
callback.call(memoryBean.getHeapMemoryUsage().getUsed(), "heap");
callback.call(memoryBean.getNonHeapMemoryUsage().getUsed(), "nonheap");
})
.register();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic GaugeWithCallback.Builderbuilder()static GaugeWithCallback.Builderbuilder(PrometheusProperties properties) GaugeSnapshotcollect()Methods inherited from class MetricWithFixedMetadata
getPrometheusNameMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Collector
collect, collect, collect