From 9462b7ea4e899dc8e331bdaa42846c13493a6fe6 Mon Sep 17 00:00:00 2001 From: Jasper Bernhardt Date: Thu, 16 Jul 2020 09:04:57 +0200 Subject: [PATCH] Fix nanocore sum for non default intervals on Kubernetes Overview Dashboard (#19675) * 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 4dcbde39492bdc3843034bba8db811c68cb44b97) --- CHANGELOG.asciidoc | 1 + .../Metricbeat-kubernetes-overview.json | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 4412e6969c1f..6d164c6b1541 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 b3341000c455..155a53b11c18 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,