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. You can configure targets either by annotating pods in your Kubernetes cluster or by listing static endpoints in your Helm values. To configure the ZooKeeper integration, follow these steps:
  1. To collect from ZooKeeper pods in Kubernetes, add a CXDOT integration annotation to the pod template. The annotation key must end with the container name. For example, add the following annotation to your ZooKeeper workload:
    The Collector replaces ${target.host} with the pod IP address and ${target.port.client} with the container port named client. The Collector also discovers ZooKeeper pods that carry the app.kubernetes.io/name: zookeeper label and listen on port 2181. A CXDOT integration annotation takes precedence over the label for its container. To stop collecting from a container, set zookeeper: {enabled: false} in the annotation. Metrics from each discovered pod include that pod’s Kubernetes metadata. For more information, see autodiscovery.
  2. Optional: To collect from ZooKeeper servers outside your Kubernetes cluster, configure static targets. 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 discovery. 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 annotated pods 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 discovering pods.
  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 collection.cxdot.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: []. 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.