From bf32560ad54b092757b8bc045ee8b9a73739b614 Mon Sep 17 00:00:00 2001 From: Chris Mark Date: Thu, 16 Jul 2020 15:26:39 +0300 Subject: [PATCH] Fix nanocore sum for non default intervals on Kubernetes Overview Dashboard (#19675) (#19979) * Fix nanocore sum for non default intervals on Kubernetes Overview Dashboard The Kibana visualization CPU usage by node [Metricbeat Kubernetes] ECS did not account for x-axis scaling. In case the scaling aligned with the value from metricset.period it was correct. In every other case, the sum was not correctly calculated as it did not take into account how big the buckets in the visualizations would be. * Add changelog entry for k8s dashboard node usage (cherry picked from commit 114f78cd19936d8014303e557ea6d35bd397306d) Co-authored-by: Jasper Bernhardt --- CHANGELOG.asciidoc | 1 + .../Metricbeat-kubernetes-overview.json | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 4412e6969c1..6d164c6b154 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -33,6 +33,7 @@ https://github.com/elastic/beats/compare/v7.5.0...v7.5.1[View commits] - Fix ListMetrics pagination in aws module. {issue}14926[14926] {pull}14942[14942] - Fix CPU count in docker/cpu in cases where no `online_cpus` are reported {pull}15070[15070] - Add domain state to kvm module {pull}17673[17673] +- Fix Kubernetes Overview Dashboard to correctly display non 10s intervals for node usage {pull}19675[19675] [[release-notes-7.5.0]] === Beats version 7.5.0 diff --git a/metricbeat/module/kubernetes/_meta/kibana/7/dashboard/Metricbeat-kubernetes-overview.json b/metricbeat/module/kubernetes/_meta/kibana/7/dashboard/Metricbeat-kubernetes-overview.json index b3341000c45..155a53b11c1 100644 --- a/metricbeat/module/kubernetes/_meta/kibana/7/dashboard/Metricbeat-kubernetes-overview.json +++ b/metricbeat/module/kubernetes/_meta/kibana/7/dashboard/Metricbeat-kubernetes-overview.json @@ -126,6 +126,28 @@ "field": "kubernetes.container.cpu.usage.nanocores", "id": "0d5c9221-2bf2-11e7-859b-f78b612cde28", "type": "sum" + }, + { + "id": "8b346300-bf95-11ea-a07c-851701f0d645", + "type": "avg", + "field": "metricset.period" + }, + { + "id": "25ae6580-bf95-11ea-a07c-851701f0d645", + "type": "calculation", + "variables": [ + { + "id": "39e40aa0-bf95-11ea-a07c-851701f0d645", + "name": "sum_nanocores", + "field": "0d5c9221-2bf2-11e7-859b-f78b612cde28" + }, + { + "id": "85213600-bf95-11ea-a07c-851701f0d645", + "name": "avg_period", + "field": "8b346300-bf95-11ea-a07c-851701f0d645" + } + ], + "script": "params.sum_nanocores / (params._interval / params.avg_period)" } ], "override_index_pattern": 0,