Class SimpleclientCollector
Object
SimpleclientCollector
- All Implemented Interfaces:
MultiCollector
Bridge from
simpleclient
(version 0.16.0 and older) to the new prometheus-metrics
(version 1.0.0 and newer).
Usage: The following line will register all metrics from a simpleclient
CollectorRegistry.defaultRegistry
to a prometheus-metrics
PrometheusRegistry.defaultRegistry
:
SimpleclientCollector.builder().register();
If you have custom registries (not the default registries), use the following snippet:
CollectorRegistry simpleclientRegistry = ...;
PrometheusRegistry prometheusRegistry = ...;
SimpleclientCollector.builder()
.collectorRegistry(simpleclientRegistry)
.register(prometheusRegistry);
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder
(PrometheusProperties config) Currently there are no configuration options for the SimpleclientCollector.collect()
Called when the Prometheus server scrapes metrics.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface MultiCollector
collect, collect, collect, getPrometheusNames
-
Method Details
-
collect
Description copied from interface:MultiCollector
Called when the Prometheus server scrapes metrics.- Specified by:
collect
in interfaceMultiCollector
-
builder
Currently there are no configuration options for the SimpleclientCollector. However, we want to follow the pattern to pass the config everywhere so that we can introduce config options later without the need for API changes. -
builder
-