kafka-logsize-exporter
项目源码github
Installation
下载项目并解压
Getting Started
pip install -r requirements.txt
vim cluster.conf
# 集群别名
[kafka1003]
# zookeeper地址
zk = 127.0.0.1:2128/kafka1003
# kafka集群,多个节点用逗号','隔开
brokers = broker1,broker2
python logsize_exporter.py
运行脚本即可通过flask
启动一个web服务器
Result
访问hostname:8082即可获取到相关数据
在Prometheus中新建一个任务
scrape_configs:
- job_name: "Kafka_LogSize"
static_configs:
- targets:
- hostname:8082
scrape_interval: 20s
scrape_timeout: 10s
Enhancement
- [ ] 端口可配置
- [ ] 支持多集群