diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 6d24690f04a..469f36912b0 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -392,6 +392,7 @@ field. You can revert this change by configuring tags for the module and omittin - Update fields.yml in the azure module, missing metrics field. {pull}20918[20918] - 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 508e7b465e0..9c92894fb29 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 c4285c270c0..32c0c2d7ec3 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.