Prometheus是一套开源的监控&报警&时间序列数据库的组合,Prometheus监控服务器的基础资源(如:内存、CPU、网络等资源),也可以监控Kafka、MySQL、EMQ等消息中间件、日志监控,当然也可以监控某个进程(应用程序)或某几个进程(进程组)。
本文主要通过process-exporter 对进程进行监控,并介绍Process-exporter的使用说明。
Prometheus+Grafana的安装配置本文就不在累述,可参考: https://blog.csdn.net/skh2015java/article/details/102572363
process-exporter使用
源码地址:https://github.com/ncabatoff/process-exporter
下载地址:https://github.com/ncabatoff/process-exporter/releases/tag/v0.5.0
process-exporter可以使用命令行参数也可以指定配置文件启动
命令行常用的参数:
Usage of process-exporter:
-children
if a proc is tracked, track with it any children that aren't part of their own group (default true)
-config.path string
path to YAML config file
-debug
log debugging information to stdout
-man
print manual
-namemapping string
comma-separated list, alternating process name and capturing regex to apply to cmdline
-once-to-stdout-delay duration
Don't bind, just wait this much time, print the metrics once to stdout, and exit
-procfs string
path to read proc data from (default "/proc")
-procnames string
comma-separated list of process names to monitor
-recheck
recheck process names o