Class PrometheusMetricsProvider
- java.lang.Object
-
- org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
-
- All Implemented Interfaces:
MetricsProvider
public class PrometheusMetricsProvider extends Object implements MetricsProvider
A Metrics Provider implementation based on https://prometheus.io.- Since:
- 3.6.0
-
-
Constructor Summary
Constructors Constructor Description PrometheusMetricsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Properties configuration)voiddump(BiConsumer<String,Object> sink)Dump all values to the 4lw interface and to the Admin server.MetricsContextgetRootContext()voidresetAllValues()voidstart()voidstop()
-
-
-
Method Detail
-
configure
public void configure(Properties configuration) throws MetricsProviderLifeCycleException
- Specified by:
configurein interfaceMetricsProvider- Throws:
MetricsProviderLifeCycleException
-
start
public void start() throws MetricsProviderLifeCycleException- Specified by:
startin interfaceMetricsProvider- Throws:
MetricsProviderLifeCycleException
-
getRootContext
public MetricsContext getRootContext()
- Specified by:
getRootContextin interfaceMetricsProvider
-
stop
public void stop()
- Specified by:
stopin interfaceMetricsProvider
-
dump
public void dump(BiConsumer<String,Object> sink)
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
-
-