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

add process resource limits to procstat input #3231

Merged
merged 1 commit into from
Sep 15, 2017
Merged

add process resource limits to procstat input #3231

merged 1 commit into from
Sep 15, 2017

Conversation

phemmer
Copy link
Contributor

@phemmer phemmer commented Sep 14, 2017

This adds resource limits to the procstat input plugin.

closes #2617

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

fields[prefix+"rlimit_"+name+"_soft"] = rlim.Soft
fields[prefix+"rlimit_"+name+"_hard"] = rlim.Hard
if name != "file_locks" { // gopsutil doesn't currently track the used file locks count
fields[prefix+name] = rlim.Used
Copy link
Contributor Author

@phemmer phemmer Sep 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention here is that the fields being added are rlimit_FOO_soft and rlimit_FOO_hard for which there is a field named FOO is the current value. Some of these the FOO field already existed (e.g. memory_rss), and some it is a new field (e.g. nice_priority).

Copy link
Contributor

@danielnelson danielnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, wish we didn't use the same field with a different measurement name for everything but that is sticking with the current style.


Signals related measurement names:
- procstat_[prefix_]signals_pending value=0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these 3 actually under rlimit_*?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should they be removed here then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, procstat_[prefix_]signals_pending here is the currently used value. The procstat_[prefix_]rlimit_signals_pending_hard (and _soft) down in the rlimit_* section are the limits.
Or maybe I'm misunderstanding what you mean.

Copy link
Contributor Author

@phemmer phemmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually all under one measurement. That's just how it's documented. I just kept the existing format.


Signals related measurement names:
- procstat_[prefix_]signals_pending value=0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@phemmer
Copy link
Contributor Author

phemmer commented Sep 15, 2017

Ok, I've updated enough to where it can go through formal review (out of design). Just made the tests pass (circleci failure seems unrelated), and updated docs.

- procstat_[prefix_]rlimit_signals_pending_hard value=1758
- procstat_[prefix_]rlimit_signals_pending_soft value=1758

*NOTE: Due to a limitation in an underlying library Telegraf uses, any resource limit > 2147483647 will be misreported as 2147483647.*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and I just remembered to add this little note. I think this is a major issue. But the gopsutil owners won't fix the issue because it might break consumers. (which I personally think is a lousy excuse as that's what vendoring is meant to solve)

@danielnelson danielnelson added this to the 1.5.0 milestone Sep 15, 2017
@danielnelson danielnelson added area/procstat feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin labels Sep 15, 2017
@danielnelson danielnelson merged commit 0339dc7 into influxdata:master Sep 15, 2017
@phemmer phemmer deleted the procstat-rlimit branch September 15, 2017 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/procstat feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Monitor process resource limits/usage
2 participants