Kafka集成Prometheus与Grafana

监控Kafka

依赖情况

1
2
3
4
5
# 只需部署一台服务器上
grafana
prometheus
# 部署在各kafka服务器上
kafka_exporter

prometheus.yml

1
2
3
4
5
6
scrape_configs:
- job_name: 'kafka'
static_configs:
- targets: ['hadoop01:9308','hadoop02:9308','hadoop03:9308']
labels:
instance: 'kafka'

启动

1
2
3
4
5
6
7
# kafka_exporter(多台)
./kafka_exporter --kafka.server=KafkaIP或者域名:9092 &
# prometheus
./prometheus --config.file=./conf/prometheus.yml &
# grafana
./bin/grafana-server web &
username/password: admin/admin

Grafana Dashboard

1
ID: 7589