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.17](backport #42274) [x-pack][metricbeat][iis] improve error handling on pdh counters in application_pool data stream #42335

Open
wants to merge 7 commits into
base: 8.17
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 17, 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)

# Conflicts:
#	x-pack/metricbeat/module/iis/application_pool/reader.go
@mergify mergify bot requested a review from a team as a code owner January 17, 2025 09:37
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Jan 17, 2025
Copy link
Contributor Author

mergify bot commented Jan 17, 2025

Cherry-pick of a3cefc0 has failed:

On branch mergify/bp/8.17/pr-42274
Your branch is up to date with 'origin/8.17'.

You are currently cherry-picking commit a3cefc060.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CHANGELOG-developer.next.asciidoc

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   x-pack/metricbeat/module/iis/application_pool/reader.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 17, 2025
@botelastic
Copy link

botelastic bot commented Jan 17, 2025

This pull request doesn't have a Team:<team> label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant