11、kafka_export 监控
wget https://github.com/danielqsj/kafka_exporter/releases/download/v1.2.0/kafka_exporter-1.2.0.linux-amd64.tar.gz
grafana 模板 7589 10466
tar xf kafka_exporter-1.2.0.linux-amd64.tar.gz -C /montion/
nohup ./kafka_exporter --kafka.server=x.x.x.x:9092 &
---------------- kafka consul 配置
[root@kafka kafka_exporter-1.2.0.linux-amd64]# cat kafka.json
{
"ID": "kafka-instance-x.x.x.x",
"Name": "kafka-instance-x.x.x.x",
"Tags": [
"kafka_instance"
],
"Address": "x.x.x.x",
"Port": 9308,
"Meta": {
"instance": "kafka-instance-x.x.x.x",
"role": "kafka"
},
"EnableTagOverride": false,
"Check": {
"HTTP": "http://x.x.x.x:9308/metrics",
"Interval": "10s"
},
"Weights": {
"Passing": 10,
"Warning": 1
}
}
# Prometheus 配置
- job_name: 'kafka'
static_configs:
- targets: ['x.x.x.x:9308']
labels:
instance: 'x.x.x.x-1'
role: 'kafka-1'
--------------- kafka 注册
curl -X PUT --data @kafka.json http://x.x.x.x:8500/v1/agent/service/register
--------------- 删除
curl --request PUT http://x.x.x.x:8500/v1/agent/service/deregister/consul-instance-x.x.x.x