diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 732a050b8540..5579fa560365 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -45,6 +45,7 @@ https://github.com/elastic/beats/compare/v7.2.0...7.2[Check the HEAD diff] *Metricbeat* - Print errors that were being omitted in vSphere metricsets {pull}12816[12816] +- Fix panic in Redis Key metricset when collecting information from a removed key. {pull}13426[13426] *Packetbeat* diff --git a/metricbeat/module/redis/key/key.go b/metricbeat/module/redis/key/key.go index 62fffe34e017..2c2f6020d244 100644 --- a/metricbeat/module/redis/key/key.go +++ b/metricbeat/module/redis/key/key.go @@ -104,9 +104,14 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error { r.Error(err) continue } + if keyInfo == nil { + m.Logger().Debugf("Ignoring removed key %s from keyspace %d", key, p.Keyspace) + continue + } event := eventMapping(p.Keyspace, keyInfo) if !r.Event(event) { - return errors.New("metricset has closed") + m.Logger().Debug("Failed to report event, interrupting fetch") + return nil } } }