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 pattern allow list as input #14498

Closed
hertz1987 opened this issue Dec 22, 2023 · 4 comments
Closed

procstat pattern allow list as input #14498

hertz1987 opened this issue Dec 22, 2023 · 4 comments
Labels
feature request Requests for new plugin and for new features to existing plugins waiting for response waiting for response from contributor

Comments

@hertz1987
Copy link

Use Case

We need to gather multiple processes (>50) with the same settings ( fieldpass & tagexclude ), but don't want to repeat these settings in all those configuration files (procstat/.conf), instead we wish to use a single configuration file

Expected behavior

A single procstat.conf would be sufficient for gathering all processes:
[[inputs.procstat]]
pattern = ['patternA',
'patternB',
'patternC',
...,
'patternZZZ'
]

fieldpass = ['memory_rss', 'memory_swap']
tagexclude = ['pattern']

Actual behavior

We must either:

  1. write all patterns in one line (which is pretty ugly when there are more than 50 process patterns):

[[inputs.procstat]]
pattern = 'patternA|patternB|patternC|...|patternZZZ'

fieldpass = ['memory_rss', 'memory_swap']
tagexclude = ['pattern']

or
2. write a configuration file for each process, but the settings ( fieldpass / tagexclude /...) would be redundant across all these configuration files which makes maintenance quite difficult:

patternA.conf:
[[inputs.procstat]]
pattern = 'patternA'
fieldpass = ['memory_rss', 'memory_swap']
tagexclude = ['pattern']

patternB.conf:
[[inputs.procstat]]
pattern = 'patternB'
fieldpass = ['memory_rss', 'memory_swap']
tagexclude = ['pattern']

...

patternZZZ.conf:
pattern = 'patternZZZ'
fieldpass = ['memory_rss', 'memory_swap']
tagexclude = ['pattern']

Additional info

No response

@hertz1987 hertz1987 added the feature request Requests for new plugin and for new features to existing plugins label Dec 22, 2023
@powersj
Copy link
Contributor

powersj commented Jan 11, 2024

@hertz1987,

My apologies for missing this and a delay in response.

@srebhan and I had looked into this before the holidays and had concerns around doing this. Unlike the other plugins that have a list of URLs or other items to loop through, the procstat plugin does some special data collection points and we have concerns around how timing is reported for each result. When Sven is back in next week I'll try to get a more detailed explanation and a decision.

@srebhan
Copy link
Member

srebhan commented Jan 22, 2024

@hertz1987 sorry for the late response!

The main concerns from my side regarding the suggested change are

  1. The code becomes more complex as we also need to accumulate the found processed for the "total" metrics
  2. It becomes unclear what the "total" metrics are about. Do we now get one total per pattern? Or a total for the array of patterns? Or both?
  3. It might serve as an example for requesting this to other plugins where the above issues are even more severe.

There are additional timing issues when assuming you want a total over the whole list, but that's another story.

Honestly speaking, as for all large installations, you should create a template and just generate the plugin configs from the template and your list if you want to avoid editing those manually...

@srebhan
Copy link
Member

srebhan commented May 6, 2024

@hertz1987 this should be possible since PR #14948 by using filter section(s). Could you please use a nightly build to verify this issue is solved?

@srebhan srebhan added the waiting for response waiting for response from contributor label May 6, 2024
@telegraf-tiger
Copy link
Contributor

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Forums or provide additional details in this issue and reqeust that it be re-opened. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins waiting for response waiting for response from contributor
Projects
None yet
Development

No branches or pull requests

3 participants