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.newBuilder()
.withName("classes_loaded_total")
.withHelp("The total number of classes that have been loaded since the JVM has started execution")
.withCallback(callback -> callback.call(classLoadingMXBean.getLoadedClassCount()))
.register();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
-
Field Summary
Fields inherited from class io.prometheus.metrics.core.metrics.MetricWithFixedMetadata
labelNames
Fields inherited from class io.prometheus.metrics.core.metrics.Metric
constLabels
-
Method Summary
Modifier and TypeMethodDescriptionio.prometheus.metrics.model.snapshots.CounterSnapshot
collect()
protected io.prometheus.metrics.model.snapshots.Labels
makeLabels
(String... labelValues) static CounterWithCallback.Builder
static CounterWithCallback.Builder
newBuilder
(io.prometheus.metrics.config.PrometheusProperties properties) Methods inherited from class io.prometheus.metrics.core.metrics.MetricWithFixedMetadata
getMetadata
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.prometheus.metrics.model.registry.Collector
collect, getPrometheusName
-
Method Details
-
collect
-
newBuilder
-
newBuilder
public static CounterWithCallback.Builder newBuilder(io.prometheus.metrics.config.PrometheusProperties properties) -
makeLabels
-