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

io stats per process #1300

Closed
whetherharder opened this issue May 31, 2016 · 13 comments
Closed

io stats per process #1300

whetherharder opened this issue May 31, 2016 · 13 comments

Comments

@whetherharder
Copy link

Feature Request

It would be quite useful to have io statistics (iops, reads/per-sec,writes/sec etc), for paticular process. It would be perfect, to have also network stats per process.
If there is already a way to get such statistics, using existing set of plugins, let me know please

@sparrc
Copy link
Contributor

sparrc commented May 31, 2016

@whetherharder
Copy link
Author

whetherharder commented May 31, 2016

Sorry for bothering you with io stats they are already present as it is writen in docs!. My problem is that not all metrics were pushed to influxdb

So
select * from "procstat" limit 1
returns only these fields:
cpu_time_guest cpu_time_guest_nice cpu_time_idle cpu_time_iowait cpu_time_irq cpu_time_nice cpu_time_soft_irq cpu_time_steal cpu_time_stolen cpu_time_system cpu_time_user cpu_usage host involuntary_context_switches memory_rss memory_swap memory_vms num_threads pattern pid process_name service_name voluntary_context_switches

while telegraf -test -config input.procstat.custom.zookeeper.conf returns
[root@SRV2-VTG-VM47 telegraf.d]# telegraf -test -config input.procstat.custom.zookeeper.conf

  • Plugin: procstat, Collection 1

    procstat,host=SRV2-VTG-VM47,pattern=zookeeper,pid=16022,process_name=telegraf,service_name=zookeeper cpu_time_guest=0,cpu_time_guest_nice=0,cpu_time_idle=0,cpu_time_iowait=0,cpu_time_irq=0,cpu_time_nice=0,cpu_time_soft_irq=0,cpu_time_steal=0,cpu_time_stolen=0,cpu_time_system=0.01,cpu_time_user=0.02,involuntary_context_switches=1i,memory_rss=15986688i,memory_swap=0i,memory_vms=511963136i,num_fds=5i,num_threads=14i,read_bytes=0i,read_count=906i,voluntary_context_switches=53i,write_bytes=3i,write_count=3i 1464736322487619429

My configuration is:
Telegraf - version 0.13.1
InfluxDb - version 0.9.3

May be InfluxDb is too old?

@whetherharder
Copy link
Author

Looks like a bug or some misconfiguration
I tried to reproduce the same scenario on influxdb 13.0 and the result was the same -- a part of fields are not pushed to influxdb

I have a guess, that the reason is in some kind of configured or hardcoded limit of fields to transmit. The set fields that is pushed is always identical

@sparrc
Copy link
Contributor

sparrc commented Jun 1, 2016

Only possiblity I can think of would be that it's a permissions issue, could you try running sudo -u telegraf telegraf -test -config input.procstat.custom.zookeeper.conf and see if the output is different?

@whetherharder
Copy link
Author

I am running telegraf under root as as a service
31.05.2016 18:30 пользователь "Cameron Sparr" notifications@github.com
написал:

there's the procstat plugin:
https://github.com/influxdata/telegraf/tree/master/plugins/inputs/procstat


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1300 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AD_WapALQ72P7hLk653Yv0OkgB1hCXB9ks5qHFQBgaJpZM4Iqp69
.

@whetherharder
Copy link
Author

But i will check this point. Thanks
01.06.2016 16:51 пользователь "Cameron Sparr" notifications@github.com
написал:

Only possiblity I can think of would be that it's a permissions issue,
could you try running sudo -u telegraf telegraf -test -config
input.procstat.custom.zookeeper.conf and see if the output is different?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1300 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AD_WauY95EyXPSrhs-ECE6Vvv3Nl5Ba2ks5qHY5YgaJpZM4Iqp69
.

@sparrc
Copy link
Contributor

sparrc commented Jun 1, 2016

Unless you're rolling your own init.sh or telegraf.service scripts I think it will run under the telegraf user anyways

@sparrc
Copy link
Contributor

sparrc commented Jun 7, 2016

@whetherharder any updates?

@Finistere
Copy link

I just tried running sudo -u telegraf telegraf -test -config custom_procstat.conf and got:

  • Plugin: procstat, Collection 2

    procstat,host=hadoop-node-1,pattern=bash,pid=2129,process_name=bash cpu_time_guest=0,cpu_time_guest_nice=0,cpu_time_idle=0,cpu_time_iowait=0,cpu_time_irq=0,cpu_time_nice=0,cpu_time_soft_irq=0,cpu_time_steal=0,cpu_time_stolen=0,cpu_time_system=0.06,cpu_time_user=0.01,involuntary_context_switches=5i,memory_rss=2183168i,memory_swap=0i,memory_vms=118153216i,num_threads=1i,voluntary_context_switches=441i 1468763178088860035

I don't see any I/O stat in it.

Configuration:
Telegraf 0.13.1
CentOS 7.2

Is there something I might have missed ?

@sparrc
Copy link
Contributor

sparrc commented Jul 17, 2016

@Finistere I believe the issue would be that your telegraf user doesn't have permission to gather these stats. What happens when you run as root?

@Finistere
Copy link

Finistere commented Jul 17, 2016

@sparrc Indeed, with root it works fine. The records are also correctly stored in InfluxDB (version 0.13.0).
Thanks for the help!

@sparrc
Copy link
Contributor

sparrc commented Oct 27, 2016

closing as it appears to be a permissions issue.

If there is a specific workaround that should be pointed out, please submit a PR to change the plugin README, thanks

@mossad-zika
Copy link

I don't think it works nowadays ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants