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

feat(inputs.win_perf_counter): allow errors to be ignored #10535

Merged
merged 10 commits into from
Feb 1, 2022

Conversation

sspaink
Copy link
Contributor

@sspaink sspaink commented Jan 27, 2022

resolve: #7281

  • Wrote appropriate unit tests.

I took the PR started by (#7282) @bielawb (thanks!) to resolve the outstanding issues. To avoid using a boolean in the config as the original PR suggested, I replaced it with a list of strings accepting the names of any PDH (Performance Data Helper) error instead of only allowing to ignore PDH_NO_DATA. I also added a unit test which was a blocker for the original PR.

Yet again thanks @bielawb for the original PR, if you have sometime to test these new changes and give any feedback that would be appreciated. Your PR was open for a while so sorry about that!

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jan 27, 2022
Comment on lines +38 to +43
## Accepts a list of PDH error codes which are defined in pdh.go, if this error is encountered it will be ignored
## For example, you can provide "PDH_NO_DATA" to ignore performance counters with no instances
## By default no errors are ignored
## You can find the list here: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/win_perf_counters/pdh.go
## e.g.: IgnoredErrors = ["PDH_NO_DATA"]
# IgnoredErrors = []
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be copied into the readme.md too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sspaink sspaink added the area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) label Jan 27, 2022
@sspaink sspaink added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jan 27, 2022
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks for wrapping this one up!

@reimda reimda merged commit d61f2e4 into master Feb 1, 2022
@reimda reimda deleted the forkallowNoDataInConfig branch February 1, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

win_perf_counter input plugin - issue when instances are not always present
4 participants