Repository navigation
metricbeat/module/windows/perfmon: report the instance count of a single instance - #54934
Open
srednoff888-art wants to merge 1 commit into
Open
srednoff888-art wants to merge 1 commit into
srednoff888-art wants to merge 1 commit into
Conversation
…gle instance With perfmon.group_all_counter, groupToSingleEvent left the instance count out when it was 1, to keep it off the counters that have no instances to count, such as _Total. So iis.webserver.process.worker_process_count was missing on a server with one w3wp process. Decide by the query instead: report the count for counters queried with a wildcard instance, whatever it is. All counters of a namespace write the same field in map order, and one of them can miss the value of an instance, so report the highest count of the namespace. Assisted-By: Claude Code
|
This pull request doesn't have a |
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
The
iis.webserverqueries show why theval == 1check can't just be removed.Web Service(_Total),ASP.NET Applications(__Total__),ASP.NETandWeb Service Cacheall have exactly one value, and would each get aworker_process_countof 1. OnlyProcess(w3wp*)has instances to count.isWildcard, which the reader already uses when it adds counters, tells them apart.Counts above 1 are reported as before, also for queries without a wildcard.
The highest count matters once 1 is reported. With two worker processes, a rate counter such as
% Processor Timecan skip one of them (PDH_CALC_NEGATIVE_VALUE), and its count of 1 could then overwrite the 2 of the otherprocess.*counters, depending on map order.Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesstresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
None.
worker_process_countis now also present when it is 1.iis.webserveris the only metricset in this repository that setsperfmon.group_all_counter.How to test this PR locally
On Windows:
TestGroupToSingleEventInstanceCount/one_instance_of_a_wildcardfails without the change; the other cases keep the rest of the behavior in place. All the tests of the package pass on Windows 10 (amd64). I did not run them with the race detector.I also ran the reader against real counters on that machine, with
group_all_counterset and the instancesexplorer*(one process),svchost*(many),nosuchprocess*and_Total:explorer*svchost*nosuchprocess*_Total(The number of
svchostprocesses changed between the two runs.) I don't have an IIS server to run theiis.webservermetricset itself.Related issues