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

fix(inputs.win_perf_counters): Ignore PdhCstatusNoInstance as well #14570

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Jan 12, 2024

Summary

Ignore the PdhCstatusNoInstance error so we do not stop collecting data for other counters. This PR builds on top of the change from #14526.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #14557

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jan 12, 2024
@powersj powersj self-assigned this Jan 12, 2024
@powersj powersj marked this pull request as ready for review January 16, 2024 14:28
@powersj powersj 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 16, 2024
@powersj powersj assigned srebhan and unassigned powersj Jan 16, 2024
@telegraf-tiger
Copy link
Contributor

@@ -576,6 +576,7 @@ func isKnownCounterDataError(err error) bool {
pdhErr.ErrorCode == PdhCalcNegativeDenominator ||
pdhErr.ErrorCode == PdhCalcNegativeValue ||
pdhErr.ErrorCode == PdhCstatusInvalidData ||
pdhErr.ErrorCode == PdhCstatusNoInstance ||
pdhErr.ErrorCode == PdhNoData) {
return true
}
Copy link
Member

Choose a reason for hiding this comment

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

This really should be converted to a switch statement one day.... But maybe not today. ;-)

Copy link
Member

@srebhan srebhan 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 the fix @powersj!

@srebhan srebhan added the area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) label Jan 17, 2024
@srebhan srebhan merged commit 2e52da0 into influxdata:master Jan 17, 2024
26 checks passed
@github-actions github-actions bot added this to the v1.29.3 milestone Jan 17, 2024
powersj added a commit that referenced this pull request Jan 29, 2024
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) fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins 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.

[inputs.win_perf_counters] skip PdhCstatusNoInstance error
2 participants