Class PrometheusMetricsProvider
java.lang.Object
org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
- All Implemented Interfaces:
MetricsProvider
A Metrics Provider implementation based on https://prometheus.io.
- Since:
- 3.6.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Properties configuration) voiddump(BiConsumer<String, Object> sink) Dump all values to the 4lw interface and to the Admin server.voidvoidstart()voidstop()
-
Constructor Details
-
PrometheusMetricsProvider
public PrometheusMetricsProvider()
-
-
Method Details
-
configure
- Specified by:
configurein interfaceMetricsProvider- Throws:
MetricsProviderLifeCycleException
-
start
- Specified by:
startin interfaceMetricsProvider- Throws:
MetricsProviderLifeCycleException
-
getRootContext
- Specified by:
getRootContextin interfaceMetricsProvider
-
stop
public void stop()- Specified by:
stopin interfaceMetricsProvider
-
dump
Dump all values to the 4lw interface and to the Admin server.This method is not expected to be used to serve metrics to Prometheus. We are using the MetricsServlet provided by Prometheus for that, leaving the real representation to the Prometheus Java client.
- Specified by:
dumpin interfaceMetricsProvider- Parameters:
sink- the receiver of data (4lw interface, Admin server or tests)
-
resetAllValues
public void resetAllValues()- Specified by:
resetAllValuesin interfaceMetricsProvider
-