diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 5579fa56036..db279683a4d 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 module-level fields in Kubernetes metricsets. {pull}13433[13433] - Fix panic in Redis Key metricset when collecting information from a removed key. {pull}13426[13426] *Packetbeat* diff --git a/metricbeat/module/kubernetes/container/container.go b/metricbeat/module/kubernetes/container/container.go index 4f0bbaaf386..ef9bb35d267 100644 --- a/metricbeat/module/kubernetes/container/container.go +++ b/metricbeat/module/kubernetes/container/container.go @@ -99,7 +99,7 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) { m.enricher.Enrich(events) for _, e := range events { - reporter.Event(mb.Event{MetricSetFields: e}) + reporter.Event(mb.TransformMapStrToEvent("kubernetes", e, nil)) } return diff --git a/metricbeat/module/kubernetes/node/node.go b/metricbeat/module/kubernetes/node/node.go index 4d901d7e89c..cc545356dbd 100644 --- a/metricbeat/module/kubernetes/node/node.go +++ b/metricbeat/module/kubernetes/node/node.go @@ -98,7 +98,7 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) { m.enricher.Enrich([]common.MapStr{event}) - reporter.Event(mb.Event{MetricSetFields: event}) + reporter.Event(mb.TransformMapStrToEvent("kubernetes", event, nil)) return } diff --git a/metricbeat/module/kubernetes/pod/pod.go b/metricbeat/module/kubernetes/pod/pod.go index 9cd3ff88621..b65a6a20b6d 100644 --- a/metricbeat/module/kubernetes/pod/pod.go +++ b/metricbeat/module/kubernetes/pod/pod.go @@ -98,7 +98,7 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) { m.enricher.Enrich(events) for _, e := range events { - reporter.Event(mb.Event{MetricSetFields: e}) + reporter.Event(mb.TransformMapStrToEvent("kubernetes", e, nil)) } return } diff --git a/metricbeat/module/kubernetes/system/system.go b/metricbeat/module/kubernetes/system/system.go index 07625271d9f..28d17a2bb3a 100644 --- a/metricbeat/module/kubernetes/system/system.go +++ b/metricbeat/module/kubernetes/system/system.go @@ -89,7 +89,7 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) { } for _, e := range events { - reporter.Event(mb.Event{MetricSetFields: e}) + reporter.Event(mb.TransformMapStrToEvent("kubernetes", e, nil)) } return } diff --git a/metricbeat/module/kubernetes/volume/volume.go b/metricbeat/module/kubernetes/volume/volume.go index df7b9dd594f..bc9ebb59140 100644 --- a/metricbeat/module/kubernetes/volume/volume.go +++ b/metricbeat/module/kubernetes/volume/volume.go @@ -83,7 +83,7 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) { events, err := eventMapping(body) for _, e := range events { - reporter.Event(mb.Event{MetricSetFields: e}) + reporter.Event(mb.TransformMapStrToEvent("kubernetes", e, nil)) } return