-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 shouldn't cache PID #1636
Comments
that is very odd, do you have any steps to reproduce? Are you sure there are no other conflicting configuration files? do you see any patterns, such as PID overlap or anything? |
I tried to find any pattern, but I couldn't find any (e.g. if there is another Telegraf plugin is enabled with procstat or so, but it happens in different servers and envs). But while I'm checking if there is anything with PIDs, I found the
Reuse of the PID when a process finishes is normal. So I think there is a time space between procstat gets/assigns name of process and its PID. |
I see, in that case I think I know what the bug is. The procstat plugin caches the PID because it assumes that it's not going to be changing. It does this to avoid having to query the system every interval for the pid with the given filter. I think the only solution will be to query every interval for the PID. |
Great! Thanks @sparrc :-) |
Changed the procstat input plugin to not cache PIDs. Solves influxdata#1636. The logic of creating a process by pid was moved from `procstat.go` to `spec_processor.go`.
closed by #2206 |
* Procstat: don't cache PIDs Changed the procstat input plugin to not cache PIDs. Solves influxdata#1636. The logic of creating a process by pid was moved from `procstat.go` to `spec_processor.go`. * Procstat: go fmt * procstat: modify changelog for influxdata#2206
procstat reports for processes aren't in the conf file ... and they look totally random from the system.
Here is an example for some procs name:
It collect data for these procs for sometime (also a random time) and then it stops!
System info:
System: Ubuntu 14.04.4 LTS
Telegraf: 0.13.1
pgrep: 3.3.9 (default one that comes with Ubuntu)
Steps to reproduce:
It happens randomly.
Expected behavior:
It should collect data for procs in config file only.
Actual behavior:
It collects data for arbitrary procs (and no errors related to procstat in telegraf logs).
Additional info:
Conf file:
/etc/telegraf/telegraf.d/procstat.conf
The text was updated successfully, but these errors were encountered: