categraf 监控JVM程序

Viewed 142

请问通过categraf里面的procstat如何监控java启动的jar进程,这里配置的无法详细看到各个java进程信息

# collect interval

interval = 15

[[instances]]

# executable name (ie, pgrep <search_exec_substring>)

search_exec_substring = "java"

# pattern as argument for pgrep (ie, pgrep -f <search_cmdline_substring>)

search_cmdline_substring = "n9e server"

# windows service name

search_win_service = ""

# search process with specific user, option with exec_substring or cmdline_substring

search_user = ""

# append some labels for series

labels = { region="JVM", product="n9e" }

# interval = global.interval * interval_times

interval_times = 1

# mode to use when calculating CPU usage. can be one of 'solaris' or 'irix'

mode = "irix"

sum of threads/fd/io/cpu/mem, min of uptime/limit

gather_total = false

will append pid as tag

gather_per_pid = true

gather jvm metrics only when jstat is ready

gather_more_metrics = [
"threads",
"fd",
"io",
"uptime",
"cpu",
"mem",
"limit",
"jvm"
]

2 Answers

参考文档修改一下配置呢,例如最上面3选一的search的配置,procstat采集插件