From 66a43f50d8bb6dc1d82099960ac6c5c30c0e7172 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 8 Sep 2021 07:43:53 -0400 Subject: [PATCH] [APM] Set start date of APM ML job to -4 weeks (#111375) (#111503) Closes #111045. Co-authored-by: Dario Gieselaar --- .../lib/anomaly_detection/create_anomaly_detection_jobs.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts index 28f3041d65d70..1ea9ae6b65ac5 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts @@ -9,6 +9,7 @@ import { Logger } from 'kibana/server'; import uuid from 'uuid/v4'; import { snakeCase } from 'lodash'; import Boom from '@hapi/boom'; +import moment from 'moment'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; @@ -87,6 +88,7 @@ async function createAnomalyDetectionJob({ groups: [APM_ML_JOB_GROUP], indexPatternName, applyToAllSpaces: true, + start: moment().subtract(4, 'weeks').valueOf(), query: { bool: { filter: [