From c72a22e857dd132b52e68eb2cfcb6eedd3d33d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Thu, 29 Aug 2019 00:39:40 +0200 Subject: [PATCH] [Logs UI] Remove scaling and pre-aggregation in datafeed (#44268) This simplifies the datafeed configuration by removing the date histogram aggregation and the bucket script, that scaled the document count. It also adjusts the chart's y axis label accordingly. Additionally it adds a `job_revision` metadata item to the job config that we can use to detect outdated job configs in the future in order to prompt the user to reinstall new jobs. --- .../log_analysis/api/ml_setup_module_api.ts | 30 +------------------ .../logs/analysis/sections/log_rate/chart.tsx | 4 +-- .../ml/datafeed_log_entry_rate.json | 26 +--------------- .../logs_ui_analysis/ml/log_entry_rate.json | 4 +-- 4 files changed, 6 insertions(+), 58 deletions(-) diff --git a/x-pack/legacy/plugins/infra/public/containers/logs/log_analysis/api/ml_setup_module_api.ts b/x-pack/legacy/plugins/infra/public/containers/logs/log_analysis/api/ml_setup_module_api.ts index f0ddf6657adfc..91b2ce3ba06c6 100644 --- a/x-pack/legacy/plugins/infra/public/containers/logs/log_analysis/api/ml_setup_module_api.ts +++ b/x-pack/legacy/plugins/infra/public/containers/logs/log_analysis/api/ml_setup_module_api.ts @@ -51,35 +51,7 @@ export const callSetupMlModuleAPI = async ( }, }, ], - datafeedOverrides: [ - { - job_id: 'log-entry-rate', - aggregations: { - buckets: { - date_histogram: { - field: timeField, - fixed_interval: `${bucketSpan}ms`, - }, - aggregations: { - [timeField]: { - max: { - field: `${timeField}`, - }, - }, - doc_count_per_minute: { - bucket_script: { - script: { - params: { - bucket_span_in_ms: bucketSpan, - }, - }, - }, - }, - }, - }, - }, - }, - ], + datafeedOverrides: [], }) ), }); diff --git a/x-pack/legacy/plugins/infra/public/pages/logs/analysis/sections/log_rate/chart.tsx b/x-pack/legacy/plugins/infra/public/pages/logs/analysis/sections/log_rate/chart.tsx index cd46ba8569331..71cacdcecf35d 100644 --- a/x-pack/legacy/plugins/infra/public/pages/logs/analysis/sections/log_rate/chart.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/logs/analysis/sections/log_rate/chart.tsx @@ -93,7 +93,7 @@ export const ChartView = ({ data, timeRange }: Props) => { Number(value).toFixed(0)} @@ -128,7 +128,7 @@ export const ChartView = ({ data, timeRange }: Props) => {