Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.7] [Infrastructure UI] Filter out null bucket items from average c…
…alculation (#152333) (#152461) # Backport This will backport the following commits from `main` to `8.7`: - [[Infrastructure UI] Filter out null bucket items from average calculation (#152333)](#152333) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Carlos Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-03-01T14:31:35Z","message":"[Infrastructure UI] Filter out null bucket items from average calculation (#152333)\n\n## Summary\r\n\r\nCloses [#152328](https://github.com/elastic/kibana/issues/152328)\r\n\r\nThis PR fixes the average calculation in the Snapshot API, filtering out\r\nbuckets with null values from it, which are more likely to appear with\r\nqueries that use small data ranges.\r\n\r\nThe results after this change are equal to what Elasticsearch would\r\ncalculate in the avg aggregation\r\n\r\n\r\n### How to test \r\n\r\n- Make sure you have metrics data (either through enabling the system\r\nmodule in metricbeat or connecting your local kibana to an oblt-cli\r\ncluster)\r\n- Navigate to `Infrastructure` > `Hosts`\r\n- Filter the results to see a single host\r\n- Change the data range filter and compare the KPIs against the table.\r\n- Validate other pages that use the Snapshot API (Inventory UI and\r\nMetrics UI to see if the results there are still correct\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f6a0b886b143dea6b3b6f8101e21be5c1816558a","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics UI","Team:Infra Monitoring UI","release_note:skip","backport:prev-minor","v8.7.0","Feature:ObsHosts","v8.8.0"],"number":152333,"url":"https://github.com/elastic/kibana/pull/152333","mergeCommit":{"message":"[Infrastructure UI] Filter out null bucket items from average calculation (#152333)\n\n## Summary\r\n\r\nCloses [#152328](https://github.com/elastic/kibana/issues/152328)\r\n\r\nThis PR fixes the average calculation in the Snapshot API, filtering out\r\nbuckets with null values from it, which are more likely to appear with\r\nqueries that use small data ranges.\r\n\r\nThe results after this change are equal to what Elasticsearch would\r\ncalculate in the avg aggregation\r\n\r\n\r\n### How to test \r\n\r\n- Make sure you have metrics data (either through enabling the system\r\nmodule in metricbeat or connecting your local kibana to an oblt-cli\r\ncluster)\r\n- Navigate to `Infrastructure` > `Hosts`\r\n- Filter the results to see a single host\r\n- Change the data range filter and compare the KPIs against the table.\r\n- Validate other pages that use the Snapshot API (Inventory UI and\r\nMetrics UI to see if the results there are still correct\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f6a0b886b143dea6b3b6f8101e21be5c1816558a"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/152333","number":152333,"mergeCommit":{"message":"[Infrastructure UI] Filter out null bucket items from average calculation (#152333)\n\n## Summary\r\n\r\nCloses [#152328](https://github.com/elastic/kibana/issues/152328)\r\n\r\nThis PR fixes the average calculation in the Snapshot API, filtering out\r\nbuckets with null values from it, which are more likely to appear with\r\nqueries that use small data ranges.\r\n\r\nThe results after this change are equal to what Elasticsearch would\r\ncalculate in the avg aggregation\r\n\r\n\r\n### How to test \r\n\r\n- Make sure you have metrics data (either through enabling the system\r\nmodule in metricbeat or connecting your local kibana to an oblt-cli\r\ncluster)\r\n- Navigate to `Infrastructure` > `Hosts`\r\n- Filter the results to see a single host\r\n- Change the data range filter and compare the KPIs against the table.\r\n- Validate other pages that use the Snapshot API (Inventory UI and\r\nMetrics UI to see if the results there are still correct\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f6a0b886b143dea6b3b6f8101e21be5c1816558a"}}]}] BACKPORT--> Co-authored-by: Carlos Crespo <[email protected]>
- Loading branch information