Monitor
You can use different ways to monitor a Pulsar cluster, exposing both metrics related to the usage of topics and the overall health of the individual components of the cluster.
Collect metrics​
You can collect broker stats, ZooKeeper stats, and BookKeeper stats.
Broker stats​
You can collect Pulsar broker metrics from brokers and export the metrics in JSON format. The Pulsar broker metrics mainly have two types:
-
Destination dumps, which contain stats for each individual topic. You can fetch the destination dumps using the command below:
bin/pulsar-admin broker-stats destinations -
Broker metrics, which contain the broker information and topics stats aggregated at namespace level. You can fetch the broker metrics by using the following command:
bin/pulsar-admin broker-stats monitoring-metrics
All the message rates are updated every minute.
The aggregated broker metrics are also exposed in the Prometheus format at:
http://$BROKER_ADDRESS:8080/metrics/
ZooKeeper stats​
The local ZooKeeper, configuration store server and clients that are shipped with Pulsar can expose detailed stats through Prometheus.
http://$LOCAL_ZK_SERVER:8000/metrics
http://$GLOBAL_ZK_SERVER:8001/metrics
The default port of local ZooKeeper is 8000
and the default port of the configuration store is 8001
. You can use a different stats port by configuring metricsProvider.httpPort
in the conf/zookeeper.conf
file.