码迷,mamicode.com
首页 > 其他好文 > 详细

promethues监控tomcat

时间:2018-10-24 20:08:12      阅读:563      评论:0      收藏:0      [点我收藏+]

标签:less   The   ast   XML   sam   gets   use   jvm   ESS   

promethues监控tomcat:

下载网址:
https://github.com/prometheus/jmx_exporter 点击download the jar链接

https://github.com/prometheus/jmx_exporter/blob/master/exsample_configs/tomcat.yml 复制内容另存为config.xml

mkdir /var/lib/tomcat7/prometheus

cp -rv jmx_prometheus_javaagent-0.3.1.jar /var/lib/tomcat7/prometheus/

cp -rv config.xml /var/lib/tomcat7/prometheus/

chown tomcat7:tomcat7 /var/lib/tomcat7/prometheus -R

vi /etc/default/tomcat7

JAVA_OPTS="-Djava.awt.headless=true -Xmx1028m -XX:+UseConcMarkSweepGC -javaagent:/var/lib/tomcat7/prometheus/jmx_prometheus_javaagent-0.3.1.jar=9151:/var/lib/tomcat7/prometheus/config.xml"

:wq

/etc/init.d/tomcat7 restart

浏览器访问:http://ip:9151/metrics

prometheus:

vi /space/prometheus/prometheus.yml

- targets: [‘host01:9151‘]

:wq

grafana面板:

显示总heap内存:
jvm_memory_bytes_max{area=‘heap‘,instance="$node:9151"}

显示已使用heap内存:
jvm_memory_bytes_used{area=‘heap‘,instance="$node:9151"}

promethues监控tomcat

标签:less   The   ast   XML   sam   gets   use   jvm   ESS   

原文地址:http://blog.51cto.com/yangzhiming/2308437

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!