Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

procstat input plugin: cpu_usage artificially capped at 100 #6421

Closed
sajoupa opened this issue Sep 19, 2019 · 1 comment · Fixed by #6741
Closed

procstat input plugin: cpu_usage artificially capped at 100 #6421

sajoupa opened this issue Sep 19, 2019 · 1 comment · Fixed by #6741
Labels
upstream bug or issues that rely on dependency fixes
Milestone

Comments

@sajoupa
Copy link
Contributor

sajoupa commented Sep 19, 2019

Relevant telegraf.conf:

[[inputs.procstat]]
  exe = "qemu"
  pid_tag = true

System info:

$ telegraf version
Telegraf 1.12.1
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

Steps to reproduce:

  1. On a machine where some processes use more than 100% CPU (a hypervisor running qemu in my example)
  2. Activate the procstat plugin, with adequate filters to match these processes
  3. Compare cpu usage from top, and from telegraf measurements:
$ top -b -n 1 | egrep 'CPU|^17177' ; echo ; curl -s localhost:9103/metrics | egrep 'cpu_usage.*17177'
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
17177 libvirt+  20   0 9481628 3.794g   4608 R 250.0  4.0   6816:34 qemu-system-x86

procstat_cpu_usage{exe="qemu",pid="17177",process_name="qemu-system-x86_64",user="libvirt-qemu"} 100

Expected behavior:

procstat_cpu_usage giving CPU usage in percent of 1 core (in the example above, 250).

Actual behavior:

Additional info:

This is due to shirou/gopsutil#755. I'm filing this issue here for other travellers, and track the fix release in telegraf after it's (hopefully) done in gopsutil.

@glinton
Copy link
Contributor

glinton commented Sep 19, 2019

That "artificial cap" is definitely new as #2020 is a request to essentially use the number of cpus when reporting cpu usage, rather than the irix mode that top uses by default in your example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream bug or issues that rely on dependency fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants