promethues监控tomcat

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了promethues监控tomcat相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

docker promethues 的监控部署

云原生领域的监控服务 - Promethues

Promethues (普罗米修斯)详细介绍

Promethues监控redis

Promethues-如何监控容器

Promethues如何监控容器