From 77882fc43dcb514ad10c85796edcef2c746901c2 Mon Sep 17 00:00:00 2001 From: Alex K <8418476+fearful-symmetry@users.noreply.github.com> Date: Thu, 29 Oct 2020 22:19:34 -0700 Subject: [PATCH] [Metricbeat] Remove io.time from windows (#22237) * remove io.time from windows * fix tests * add changelog entry --- CHANGELOG.next.asciidoc | 1 + metricbeat/module/system/diskio/_meta/data.json | 16 ++++++++-------- metricbeat/module/system/diskio/diskio.go | 7 ++++--- metricbeat/module/system/test_system.py | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 815b8d809f1..63e8d97ee74 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -385,6 +385,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - [Kubernetes] Remove redundant dockersock volume mount {pull}22009[22009] - Revert change to report `process.memory.rss` as `process.memory.wss` on Windows. {pull}22055[22055] - Add a switch to the driver definition on SQL module to use pretty names {pull}17378[17378] +- Remove io.time from windows {pull}22237[22237] - Add interval information to `monitor` metricset in azure. {pull}22152[22152] *Packetbeat* diff --git a/metricbeat/module/system/diskio/_meta/data.json b/metricbeat/module/system/diskio/_meta/data.json index a2301ef8888..5d58850d187 100644 --- a/metricbeat/module/system/diskio/_meta/data.json +++ b/metricbeat/module/system/diskio/_meta/data.json @@ -15,7 +15,7 @@ "system": { "diskio": { "io": { - "time": 601740 + "time": 1296 }, "iostat": { "await": 0, @@ -48,16 +48,16 @@ } } }, - "name": "sdb1", + "name": "sda6", "read": { - "bytes": 25128030208, - "count": 3146154, - "time": 833872 + "bytes": 335872, + "count": 82, + "time": 1296 }, "write": { - "bytes": 34401640448, - "count": 861040, - "time": 11224168 + "bytes": 0, + "count": 0, + "time": 0 } } } diff --git a/metricbeat/module/system/diskio/diskio.go b/metricbeat/module/system/diskio/diskio.go index 4a7e2e2b5fe..793d2d23682 100644 --- a/metricbeat/module/system/diskio/diskio.go +++ b/metricbeat/module/system/diskio/diskio.go @@ -105,9 +105,6 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error { "time": counters.WriteTime, "bytes": counters.WriteBytes, }, - "io": common.MapStr{ - "time": counters.IoTime, - }, } // accumulate values from all interfaces @@ -123,6 +120,10 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error { event["iostat"] = iostat.AddLinuxIOStat(result) } + if runtime.GOOS != "windows" { + event.Put("io.time", counters.IoTime) + } + if counters.SerialNumber != "" { event["serial_number"] = counters.SerialNumber } diff --git a/metricbeat/module/system/test_system.py b/metricbeat/module/system/test_system.py index 2e1b9e579d9..86b6dcd2d12 100644 --- a/metricbeat/module/system/test_system.py +++ b/metricbeat/module/system/test_system.py @@ -36,7 +36,7 @@ "softirq.norm.pct", "steal.norm.pct", "system.norm.pct", "user.norm.pct"] SYSTEM_DISKIO_FIELDS = ["name", "read.count", "write.count", "read.bytes", - "write.bytes", "read.time", "write.time", "io.time"] + "write.bytes", "read.time", "write.time"] SYSTEM_DISKIO_FIELDS_LINUX = ["name", "read.count", "write.count", "read.bytes", "write.bytes", "read.time", "write.time", "io.time",