Module io.prometheus.metrics.core
Class CounterWithCallback
java.lang.Object
io.prometheus.metrics.core.metrics.Metric
io.prometheus.metrics.core.metrics.MetricWithFixedMetadata
io.prometheus.metrics.core.metrics.CounterWithCallback
- All Implemented Interfaces:
io.prometheus.metrics.model.registry.Collector
Example:
ClassLoadingMXBean classLoadingMXBean = ManagementFactory.getClassLoadingMXBean();
CounterWithCallback.builder()
.name("classes_loaded_total")
.help("The total number of classes since the JVM has started execution")
.callback(callback -> callback.call(classLoadingMXBean.getLoadedClassCount()))
.register();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Field Summary
Fields inherited from class io.prometheus.metrics.core.metrics.MetricWithFixedMetadata
labelNamesFields inherited from class io.prometheus.metrics.core.metrics.Metric
constLabels -
Method Summary
Modifier and TypeMethodDescriptionstatic CounterWithCallback.Builderbuilder()static CounterWithCallback.Builderbuilder(io.prometheus.metrics.config.PrometheusProperties properties) io.prometheus.metrics.model.snapshots.CounterSnapshotcollect()protected io.prometheus.metrics.model.snapshots.LabelsmakeLabels(String... labelValues) Methods inherited from class io.prometheus.metrics.core.metrics.MetricWithFixedMetadata
getMetadata, getPrometheusNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.prometheus.metrics.model.registry.Collector
collect, collect, collect
-
Method Details
-
collect
public io.prometheus.metrics.model.snapshots.CounterSnapshot collect() -
builder
-
builder
public static CounterWithCallback.Builder builder(io.prometheus.metrics.config.PrometheusProperties properties) -
makeLabels
-