{"id":15715403,"url":"https://github.com/cloudflare/kafka_zookeeper_exporter","last_synced_at":"2025-04-10T11:11:14.947Z","repository":{"id":57567169,"uuid":"96943924","full_name":"cloudflare/kafka_zookeeper_exporter","owner":"cloudflare","description":"Prometheus exporter for Kafka cluster state stored in ZooKeeper","archived":false,"fork":false,"pushed_at":"2024-09-25T22:27:27.000Z","size":1177,"stargazers_count":70,"open_issues_count":1,"forks_count":14,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-22T22:27:20.355Z","etag":null,"topics":["exporter","kafka","metrics","prometheus","prometheus-exporter","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudflare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-11T22:57:10.000Z","updated_at":"2025-01-03T21:46:17.000Z","dependencies_parsed_at":"2024-06-19T13:35:07.323Z","dependency_job_id":"2305bfd3-665c-4a8f-b8d9-3019dbfa3c92","html_url":"https://github.com/cloudflare/kafka_zookeeper_exporter","commit_stats":{"total_commits":20,"total_committers":5,"mean_commits":4.0,"dds":"0.30000000000000004","last_synced_commit":"b64c8651cea3f8d7f707d00cbc98c0bf0b9db1d7"},"previous_names":["cloudflare/kafka-zookeeper-exporter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fkafka_zookeeper_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fkafka_zookeeper_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fkafka_zookeeper_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Fkafka_zookeeper_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudflare","download_url":"https://codeload.github.com/cloudflare/kafka_zookeeper_exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208561,"owners_count":21065202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exporter","kafka","metrics","prometheus","prometheus-exporter","zookeeper"],"created_at":"2024-10-03T21:41:26.641Z","updated_at":"2025-04-10T11:11:14.916Z","avatar_url":"https://github.com/cloudflare.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kafka ZooKeeper Exporter\n\nA daemon that exposes Kafka cluster state stored in [ZooKeeper](https://kafka.apache.org/documentation/#zk).\n\n## Motivation\n\nMetrics exported by `kafka_zookeeper_exporter` provide cluster level overview\nof the entire cluster and can be used along\n[jmx_exporter](https://github.com/prometheus/jmx_exporter) which provides broker\nlevel data. `jmx_exporter` exports what each brokers believes to be true, but\nthis information can be incorrect in case of a network partition or other split\nbrain issues. ZooKeeper on the other hand is the source of truth for the entire\ncluster configuration and runtime status, so the metrics exported from it are\nthe best representation of the entire cluster status.\n\n## Metrics\n\n### kafka_topic_partition_count\n\nNumber of partitions configured for given topic.\n\n### kafka_topic_partition_replica_count\n\nNumber of replicas configured for given partition.\n\n### kafka_topic_partition_leader\n\nThis metric will have value `1` for the replica that is currently the leader for\ngiven partition.\n\n### kafka_topic_partition_leader_is_preferred\n\nEach Kafka partition have a list of replicas, the first replica is the preferred\n(default) leader. This metric will have value `1` if the current partition\nleader is the preferred one.\n\n### kafka_topic_partition_replica_in_sync\n\nThis metric will indicate whenever given replica is in sync with the partition\nleader.\n\n### kafka_broker_is_controller\n\nThis metric will have value `1` for the broker that is currently the cluster\ncontroller.\n\n### kafka_consumers_offsets\n\nThe last offset consumed for a given (consumer, topic, partition).\n\nThis will only show metrics for legacy consumers that still store their offsets\nin Zookeeper.\n\n### kafka_zookeeper_scrape_error\n\nWill have value `1` if there was an error retrieving or processing any of the\ndata for the current scrape. `0` otherwise.\n\n## Building\n\n    go get -u github.com/cloudflare/kafka_zookeeper_exporter\n    cd $GOPATH/src/github.com/cloudflare/kafka_zookeeper_exporter\n    make\n\n## Usage\n\nStart the exporter\n\n    ./kafka_zookeeper_exporter \u003cflags\u003e\n\nTo see the list of avaiable flags run\n\n    ./kafka_zookeeper_exporter -h\n\nSend a request to collect metrics\n\n    curl localhost:9381/kafka?zookeeper=10.0.0.1:2181\u0026chroot=/kafka/cluster\u0026topic=mytopic1,mytopic2\u0026consumer=myconsumer1,myconsumer2\n\nWhere:\n\n* zookeeper - required, address of the ZooKeeper used for Kafka, can be multiple addresses separated by comma\n* chroot - path inside ZooKeeper where Kafka cluster data is stored. Has to be omitted if Kafka resides in the root of ZooKeeper.\n* topic - optional, list of topics to collect metrics for.\n  If empty or missing then all topics will be collected.\n* consumer - optional, list of consumers to collect metrics for.\n  If empty or missing then all consumers will be collected.\n\nIf both topic and consumer are non-empty, then metrics where both are relevant\nwill only be collected if they match both.\n\n## Prometheus configuration\n\nExample Prometheus scrape job configuration:\n\n    - job_name: kafka_zookeeper_exporter_mycluster\n      static_configs:\n        - targets:\n          # hostname and port `kafka-zookeeper-exporter` is listening on\n          - myserver:9381\n      metrics_path: /kafka\n      scheme: http\n      params:\n        zookeeper: ['zk1.example.com:2181,zk2.example.com:2181']\n        chroot: ['/kafka/mycluster']\n\nThis example uses `static_configs` to configure scrape target.\nSee [Prometheus docs](https://prometheus.io/docs/operating/configuration/) for other\nways to configure it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Fkafka_zookeeper_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudflare%2Fkafka_zookeeper_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Fkafka_zookeeper_exporter/lists"}