From 4c79a4b275ab48f9e6bbf15eaf7b3dc10c749746 Mon Sep 17 00:00:00 2001 From: Mariana Dima Date: Thu, 17 Sep 2020 11:44:03 +0200 Subject: [PATCH] Handling missing counters in application_pool metricset (#21071) * mofidy doc * fix * changelog (cherry picked from commit bdfff666edc019ef569782a432384aee7a0c13ce) --- CHANGELOG.next.asciidoc | 2 ++ .../module/iis/application_pool/application_pool.go | 1 - x-pack/metricbeat/module/iis/application_pool/reader.go | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index c3c1706d0552..92ccb87c9f64 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -102,6 +102,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Fix overflow on Prometheus rates when new buckets are added on the go. {pull}17753[17753] - Add a switch to the driver definition on SQL module to use pretty names {pull}17378[17378] - The `elasticsearch/index` metricset only requests wildcard expansion for hidden indices if the monitored Elasticsearch cluster supports it. {pull}20938[20938] +- Disable Kafka metricsets based on Jolokia by default. They require a different configuration. {pull}20989[20989] +- Handle missing counters in the application_pool metricset. {pull}21071[21071] *Packetbeat* diff --git a/x-pack/metricbeat/module/iis/application_pool/application_pool.go b/x-pack/metricbeat/module/iis/application_pool/application_pool.go index 508e7b465e0d..9c92894fb297 100644 --- a/x-pack/metricbeat/module/iis/application_pool/application_pool.go +++ b/x-pack/metricbeat/module/iis/application_pool/application_pool.go @@ -84,7 +84,6 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) error { break } } - return nil } diff --git a/x-pack/metricbeat/module/iis/application_pool/reader.go b/x-pack/metricbeat/module/iis/application_pool/reader.go index c4285c270c02..32c0c2d7ec39 100644 --- a/x-pack/metricbeat/module/iis/application_pool/reader.go +++ b/x-pack/metricbeat/module/iis/application_pool/reader.go @@ -101,10 +101,10 @@ func (r *Reader) initAppPools() error { if err == pdh.PDH_CSTATUS_NO_COUNTER || err == pdh.PDH_CSTATUS_NO_COUNTERNAME || err == pdh.PDH_CSTATUS_NO_INSTANCE || err == pdh.PDH_CSTATUS_NO_OBJECT { r.log.Infow("Ignoring non existent counter", "error", err, logp.Namespace("application pool"), "query", value) - continue } else { - return errors.Wrapf(err, `failed to expand counter (query="%v")`, value) + r.log.Error(err, `failed to expand counter path (query= "%v")`, value) } + continue } newQueries = append(newQueries, childQueries...) // check if the pdhexpandcounterpath/pdhexpandwildcardpath functions have expanded the counter successfully.