From 51788fd8008782ca1c4475659155879daa37c783 Mon Sep 17 00:00:00 2001 From: Mariana Dima Date: Mon, 15 Feb 2021 10:23:04 +0000 Subject: [PATCH] Add check when retrieving the worker process id using performance counters (#23647) (#23676) * fix for test * add check * changelog (cherry picked from commit 3220d463ac619102b01ca13001d3565b7537a9c5) --- CHANGELOG.next.asciidoc | 1 + x-pack/metricbeat/module/iis/application_pool/reader.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 42c4605ebb3..c81f700550d 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -303,6 +303,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Update config in `windows.yml` file. {issue}23027[23027]{pull}23327[23327] - Add stack monitoring section to elasticsearch module documentation {pull}#23286[23286] - Fix metric grouping for windows/perfmon module {issue}23489[23489] {pull}23505[23505] +- Add check for iis/application_pool metricset for nil worker process id values. {issue}23605[23605] {pull}23647[23647] - Add system.hostfs configuration option for system module. {pull}23831[23831] *Packetbeat* diff --git a/x-pack/metricbeat/module/iis/application_pool/reader.go b/x-pack/metricbeat/module/iis/application_pool/reader.go index 32c0c2d7ec3..d15b0a47747 100644 --- a/x-pack/metricbeat/module/iis/application_pool/reader.go +++ b/x-pack/metricbeat/module/iis/application_pool/reader.go @@ -263,7 +263,7 @@ func getw3wpProceses() (map[int]string, error) { func getProcessIds(counterValues map[string][]pdh.CounterValue) []WorkerProcess { var workers []WorkerProcess for key, values := range counterValues { - if strings.Contains(key, "\\ID Process") { + if strings.Contains(key, "\\ID Process") && values[0].Measurement != nil { workers = append(workers, WorkerProcess{instanceName: values[0].Instance, processId: int(values[0].Measurement.(float64))}) } }