环境
系统:CentOS 7.5
软件:jmx_prometheus_javaagent-0.3.1.jar
客户端
-
下载jmx_exporter
# mkdir -p /usr/local/prometheus/jmx_exporter # cd /usr/local/prometheus/jmx_exporter # wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.3.1/jmx_prometheus_javaagent-0.3.1.jar
-
添加配置文件
# vim /usr/local/prometheus/jmx_exporter/jmx_exporter.yml --- rules: - pattern: ".*"
-
启动jar包
# java -javaagent:/usr/local/prometheus/jmx_exporter/jmx_prometheus_javaagent-0.3.1.jar=3010:/usr/local/prometheus/jmx_exporter/jmx_exporter.yml -jar yourJar.jar
Prometheus端
-
配置Prometheus
# vim /usr/local/prometheus/prometheus.yml scrape_configs: - job_name: 'jmx' static_configs: - targets: ['10.10.10.1:3010']
-
重启Prometheus
# systemctl restart prometheus
Grafana端
- 添加dashboards
点击Create
-Import
,输入dashboards的id(推荐3457)