赞
踩
https://github.com/prometheus/jmx_exporter
测试jar包(kafka的jmx端口为9898):
java -cp collector/target/collector-0.15.1-SNAPSHOT.jar io.prometheus.jmx.JmxScraper service:jmx:rmi:///jndi/rmi://localhost:9898/jmxrmi
在首行添加kafka的jmx地址:
hostPort: localhost:9898
Windows下启动:
java -cp .\jmx_prometheus_httpserver\target\jmx_prometheus_httpserver-0.15.1-SNAPSHOT-jar-with-dependencies.jar io.prometheus.jmx.WebServer 9997 .\example_configs\kafka-2_0_0.yml
访问http://localhost:9997, 能正确返回数据
https://prometheus.io/download/
在scrape_configs节点下添加:
- job_name: 'kafka_jmx_exporter'
static_configs:
- targets: ['localhost:9997']
Windows: .\prometheus.exe
Linux: ./prometheus --config.file=prometheus.yml
https://grafana.com/grafana/download
Windows: .\bin\grafana-server.exe
Linux: .\bin\grafana-server web
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。