search
数据采集 采集源配置 Procstat 指标采集

Procstat 指标采集

简介

采集 procstat 指标上报到 DataFlux 中

前置条件

配置

进入 DataKit 安装目录下的 conf.d/processes 目录,复制 procstat.conf.sample 并命名为 procstat.conf。示例如下:

设置:

# Monitor process cpu and memory usage
[[inputs.procstat]]
  ## PID file to monitor process
  pid_file = "/var/run/nginx.pid"
  ## executable name (ie, pgrep <exe>)
  # exe = "nginx"
  ## pattern as argument for pgrep (ie, pgrep -f <pattern>)
  # pattern = "nginx"
  ## user as argument for pgrep (ie, pgrep -u <user>)
  # user = "nginx"
  ## Systemd unit name
  # systemd_unit = "nginx.service"
  ## CGroup name or path
  # cgroup = "systemd/system.slice/nginx.service"

  ## Windows service name
  # win_service = ""

  ## override for process_name
  ## This is optional; default is sourced from /proc/<pid>/status
  # process_name = "bar"

  ## Field name prefix
  # prefix = ""

  ## When true add the full cmdline as a tag.
  # cmdline_tag = false

  ## Add PID as a tag instead of a field; useful to differentiate between
  ## processes whose tags are otherwise the same.  Can create a large number
  ## of series, use judiciously.
  # pid_tag = false

  ## Method to use when finding process IDs.  Can be one of 'pgrep', or
  ## 'native'.  The pgrep finder calls the pgrep executable in the PATH while
  ## the native finder performs the search directly in a manor dependent on the
  ## platform.  Default is 'pgrep'
  # pid_finder = "pgrep"

配置好后,重启 DataKit 即可生效

采集指标

procstat 指标

指标 描述 类型 单位 Tag
child_major_faults integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
child_minor_faults integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_guest float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_guest_nice float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_idle float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_iowait float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_irq float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_nice float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_soft_irq float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_steal float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_system float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_time_user float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
cpu_usage float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
involuntary_context_switches integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
major_faults integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
memory_data integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
memory_locked integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
memory_rss integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
memory_stack integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
memory_swap integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
memory_usage float pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
memory_vms integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
minor_faults integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
nice_priority integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
num_fds integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
num_threads integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
pid integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
read_bytes integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
read_count integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
realtime_priority integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_cpu_time_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_cpu_time_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_file_locks_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_file_locks_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_data_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_data_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_locked_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_locked_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_rss_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_rss_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_stack_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_stack_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_vms_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_memory_vms_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_nice_priority_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_nice_priority_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_num_fds_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_num_fds_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_realtime_priority_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_realtime_priority_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_signals_pending_hard integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
rlimit_signals_pending_soft integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
signals_pending integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
voluntary_context_switches integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
write_bytes integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service
write_count integer pid,cmdline,process_name,pidfile,exe,pattern,user,systemd_unit,cgroup,win_service

procstat_lookup 指标

指标 描述 类型 单位 Tag
pid_count integer exe,pid_finder,pid_file,pattern,prefix,user,systemd_unit,cgroup,win_service,result
running integer exe,pid_finder,pid_file,pattern,prefix,user,systemd_unit,cgroup,win_service,result
result_code integer exe,pid_finder,pid_file,pattern,prefix,user,systemd_unit,cgroup,win_service,result