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

[8.x](backport #42274) [x-pack][metricbeat][iis] improve error handling on pdh counters in application_pool data stream #42313

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 15, 2025

Proposed commit message

The error occurs initAppPools > calls GetCounterPaths > calls ExpandWildCardPath > calls PdhExpandWildCardPath which returns no data and no error > PdhExpandWildCardPathreturns PdhErrno(syscall.ERROR_NOT_FOUND) error here > the error returns all the way back to initAppPools and since the error type isn't part of this condition an error log appears (logged here).

On why PDH's function returns no data and no error - I didn't find a coverage of this behavior in the docs. My guess is that object/counter exists but has no data in it (for w3wp process).
The fix I suggest is simply adding a check for PdhErrno(syscall.ERROR_NOT_FOUND) error in this condition which prevents those errors causing unnecessary error level log entries.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Screenshots

Before the change (Element not found.failed to expand counter path errors show up in the logs)
Screenshot 2025-01-09 at 2 14 55 PM

After the change (NO Element not found.failed to expand counter path errors show up in the logs)
Screenshot 2025-01-09 at 2 03 47 PM


This is an automatic backport of pull request #42274 done by [Mergify](https://mergify.com).

…pplication_pool data stream (#42274)

* [x-pack][metricbeat][iis] improve error handling on pdh counters in application_pool data stream

* change error checking to errors.Is

* update CHANGELOG-developer.next.asciidoc

* improve error handling

* add comments to the changes

(cherry picked from commit a3cefc0)
@mergify mergify bot added the backport label Jan 15, 2025
@mergify mergify bot requested a review from a team as a code owner January 15, 2025 09:14
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 15, 2025
@github-actions github-actions bot added Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team bugfix labels Jan 15, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 15, 2025
@stefans-elastic stefans-elastic merged commit 9187331 into 8.x Jan 15, 2025
23 checks passed
@stefans-elastic stefans-elastic deleted the mergify/bp/8.x/pr-42274 branch January 15, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport bugfix Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants