Skip to main content
The ZooKeeper integration requires CXDOT Collector 1.7.0 or greater. Apache ZooKeeper is a distributed coordination service for maintaining configuration, naming, and synchronization data. Use the ZooKeeper integration to collect connection, request, latency, and data tree metrics from ZooKeeper servers running in your environment. The ZooKeeper integration supports ZooKeeper 3.7 or greater.

Supported telemetry types

The ZooKeeper integration supports these telemetry types:

Prerequisites

The ZooKeeper integration has the following prerequisites:
  • Enable the mntr, stat, and ruok four-letter commands. For more information, see ZooKeeper four-letter commands. For example, add the following setting to zoo.cfg:
    To confirm that ZooKeeper accepts the commands, run the following commands from a host that can reach the server:
    Confirm that the mntr response includes zk_version and zk_server_state, the stat response includes the server mode, and the ruok response is imok.
  • Make the ZooKeeper client port, typically 2181, reachable from the CXDOT Collector.

Configure

The ZooKeeper integration is enabled by default. To configure the ZooKeeper integration, follow these steps:
  1. For ZooKeeper pods that listen on port 2181, add the app.kubernetes.io/name: zookeeper label to the pod template. The CXDOT Collector also discovers pods and Services that carry autodiscovery annotations for ZooKeeper. For more information, see autodiscovery. Metrics from discovered pods arrive with that pod’s Kubernetes metadata attached.
  2. Optional: Configure static targets to collect metrics from ZooKeeper servers that autodiscovery doesn’t cover, such as servers outside your Kubernetes cluster. For example, add the following to the values.yaml file for the CXDOT Collector Helm chart:
    This integration instance collects from exactly the listed targets and disables autodiscovery. In a Kubernetes deployment, the cluster-tier CXDOT Collector collects static targets through one elected replica. For more information, see architecture.
  3. Optional: Configure separate integration instances to collect from both discovered and static targets. For example, add the following to the values.yaml file for the CXDOT Collector Helm chart:
    The zookeeper/external key defines a named instance for the static targets. Configuring a named instance suppresses the implicit default instance, so the empty zookeeper: {} entry is required to keep autodiscovery running.
  4. Optional: Disable the integration to stop collecting from discovered targets. For example, add the following to the values.yaml file for the CXDOT Collector Helm chart:

Validate

To validate the ZooKeeper integration, follow these steps:
  1. In the Live Telemetry Analyzer, add the following filters:
    • __name__=cxdot.integration.target.health
    • cxdot.integration.name=zookeeper
    Confirm that each target reports 1, identified by its server.address and server.port attributes.
  2. In Metrics Explorer, run the following query while ZooKeeper clients create or delete data tree nodes:
    Confirm that the query returns the expected data tree node count for each target.

Configuration reference

Configure one ZooKeeper integration instance with the following settings. In Helm values, place these settings under config.integrations.zookeeper. In a Collector configuration file, place them under cxdot.integrations.zookeeper.

Optional settings

  • enabled Type: boolean. Optional. Default: true. Whether to run the ZooKeeper integration. If true, the Collector collects ZooKeeper metrics. If false, the Collector doesn’t run this integration.
  • endpoints Type: array of object. Optional. Default: []. Static ZooKeeper targets, specified as host:port. When this list is empty or omitted, the integration uses automatic target discovery. When the list contains targets, this integration instance collects from exactly those targets and doesn’t use automatic target discovery. Configure a second named instance to use both methods.
  • endpoints[].endpoint Type: string. Required. host:port of the target.
  • collection_interval Type: duration. Optional. Default: 15s. How often the Collector requests metrics from each ZooKeeper target.
  • timeout Type: duration. Optional. Default: 15s. Maximum time the Collector waits for a ZooKeeper target to complete one collection, including the connection attempt. This value must be greater than 0s and must not exceed collection_interval. If the deadline expires, that collection fails.