Skip to content

Commit 03f3bd3

Browse files
Merge branch 'master' into bugfix/console_example
2 parents a3951bb + 8ef9833 commit 03f3bd3

File tree

74 files changed

+2029
-2121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2029
-2121
lines changed

docs/user/alerting/action-types/pagerduty.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ Then, select the *Integrations* tab and click the *New Integration* button.
6868
* If you are creating a new service for your integration,
6969
go to
7070
https://support.pagerduty.com/docs/services-and-integrations#section-configuring-services-and-integrations[Configuring Services and Integrations]
71-
and follow the steps outlined in the *Create a New Service* section, selecting *Elastic* as the *Integration Type* in step 4.
71+
and follow the steps outlined in the *Create a New Service* section, selecting *Elastic Alerts* as the *Integration Type* in step 4.
7272
Continue with the <<pagerduty-in-elastic, In Elastic>> section once you have finished these steps.
7373

7474
. Enter an *Integration Name* in the format Elastic-service-name (for example, Elastic-Alerting or Kibana-APM-Alerting)
75-
and select Elastic from the *Integration Type* menu.
75+
and select *Elastic Alerts* from the *Integration Type* menu.
7676
. Click *Add Integration* to save your new integration.
7777
+
7878
You will be redirected to the *Integrations* tab for your service. An Integration Key is generated on this screen.

test/functional/page_objects/management/saved_objects_page.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ export function SavedObjectsPageProvider({ getService, getPageObjects }: FtrProv
8787

8888
async waitTableIsLoaded() {
8989
return retry.try(async () => {
90-
const exists = await find.existsByDisplayedByCssSelector(
91-
'*[data-test-subj="savedObjectsTable"] .euiBasicTable-loading'
90+
const isLoaded = await find.existsByDisplayedByCssSelector(
91+
'*[data-test-subj="savedObjectsTable"] :not(.euiBasicTable-loading)'
9292
);
93-
if (exists) {
93+
94+
if (isLoaded) {
95+
return true;
96+
} else {
9497
throw new Error('Waiting');
9598
}
96-
return true;
9799
});
98100
}
99101

x-pack/plugins/ml/common/constants/field_types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ export enum ML_JOB_FIELD_TYPES {
1717

1818
export const MLCATEGORY = 'mlcategory';
1919
export const DOC_COUNT = 'doc_count';
20+
21+
// List of system fields we don't want to display.
22+
export const OMIT_FIELDS: string[] = ['_source', '_type', '_index', '_id', '_version', '_score'];

x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export interface Detector {
6565
function: string;
6666
over_field_name?: string;
6767
partition_field_name?: string;
68-
use_null?: string;
68+
use_null?: boolean;
6969
custom_rules?: CustomRule[];
7070
}
7171
export interface AnalysisLimits {
@@ -80,7 +80,7 @@ export interface DataDescription {
8080
}
8181

8282
export interface ModelPlotConfig {
83-
enabled: boolean;
83+
enabled?: boolean;
8484
annotations_enabled?: boolean;
8585
terms?: string;
8686
}

x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/form_options_validation.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import { BASIC_NUMERICAL_TYPES, EXTENDED_NUMERICAL_TYPES } from '../../../../com
1212

1313
export const CATEGORICAL_TYPES = new Set(['ip', 'keyword']);
1414

15-
// List of system fields we want to ignore for the numeric field check.
16-
export const OMIT_FIELDS: string[] = ['_source', '_type', '_index', '_id', '_version', '_score'];
17-
1815
// Regression supports numeric fields. Classification supports categorical, numeric, and boolean.
1916
export const shouldAddAsDepVarOption = (field: Field, jobType: AnalyticsJobType) => {
2017
if (field.id === EVENT_RATE_FIELD_ID) return false;

x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import { FormattedMessage } from '@kbn/i18n/react';
1111
import { AnalyticsJobType } from '../../../analytics_management/hooks/use_create_analytics_form/state';
1212
import { ANALYSIS_CONFIG_TYPE } from '../../../../common/analytics';
1313
import { Field, EVENT_RATE_FIELD_ID } from '../../../../../../../common/types/fields';
14+
import { OMIT_FIELDS } from '../../../../../../../common/constants/field_types';
1415
import { BASIC_NUMERICAL_TYPES, EXTENDED_NUMERICAL_TYPES } from '../../../../common/fields';
15-
import { OMIT_FIELDS, CATEGORICAL_TYPES } from './form_options_validation';
16+
import { CATEGORICAL_TYPES } from './form_options_validation';
1617
import { ES_FIELD_TYPES } from '../../../../../../../../../../src/plugins/data/public';
1718
import { newJobCapsService } from '../../../../../services/new_job_capabilities_service';
1819

x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
import { getAnalyticsFactory } from '../../services/analytics_service';
4040
import { getTaskStateBadge, getJobTypeBadge, useColumns } from './use_columns';
4141
import { ExpandedRow } from './expanded_row';
42+
import { stringMatch } from '../../../../../util/string_utils';
4243
import {
4344
ProgressBar,
4445
mlInMemoryTableFactory,
@@ -65,14 +66,6 @@ function getItemIdToExpandedRowMap(
6566
}, {} as ItemIdToExpandedRowMap);
6667
}
6768

68-
function stringMatch(str: string | undefined, substr: any) {
69-
return (
70-
typeof str === 'string' &&
71-
typeof substr === 'string' &&
72-
(str.toLowerCase().match(substr.toLowerCase()) === null) === false
73-
);
74-
}
75-
7669
const MlInMemoryTable = mlInMemoryTableFactory<DataFrameAnalyticsListRow>();
7770

7871
interface Props {

x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ import { getToastNotifications } from '../../../util/dependency_cache';
1010
import { IndexPattern } from '../../../../../../../../src/plugins/data/public';
1111

1212
import { SavedSearchQuery } from '../../../contexts/ml';
13+
import { OMIT_FIELDS } from '../../../../../common/constants/field_types';
1314
import { IndexPatternTitle } from '../../../../../common/types/kibana';
1415

1516
import { ml } from '../../../services/ml_api_service';
1617
import { FieldRequestConfig } from '../common';
1718

18-
// List of system fields we don't want to display.
19-
const OMIT_FIELDS: string[] = ['_source', '_type', '_index', '_id', '_version', '_score'];
2019
// Maximum number of examples to obtain for text type fields.
2120
const MAX_EXAMPLES_DEFAULT: number = 10;
2221

x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import rison from 'rison-node';
1111
import { mlJobService } from '../../../services/job_service';
1212
import { ml } from '../../../services/ml_api_service';
1313
import { getToastNotifications } from '../../../util/dependency_cache';
14+
import { stringMatch } from '../../../util/string_utils';
1415
import { JOB_STATE, DATAFEED_STATE } from '../../../../../common/constants/states';
1516
import { parseInterval } from '../../../../../common/util/parse_interval';
1617
import { i18n } from '@kbn/i18n';
@@ -350,14 +351,6 @@ export function checkForAutoStartDatafeed() {
350351
}
351352
}
352353

353-
function stringMatch(str, substr) {
354-
return (
355-
typeof str === 'string' &&
356-
typeof substr === 'string' &&
357-
(str.toLowerCase().match(substr.toLowerCase()) === null) === false
358-
);
359-
}
360-
361354
function jobProperty(job, prop) {
362355
const propMap = {
363356
job_state: 'jobState',

x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,23 +226,39 @@ export class JobCreator {
226226
this._calendars = calendars;
227227
}
228228

229-
public set modelPlot(enable: boolean) {
230-
if (enable) {
231-
this._job_config.model_plot_config = {
232-
enabled: true,
233-
};
234-
} else {
235-
delete this._job_config.model_plot_config;
229+
private _initModelPlotConfig() {
230+
// initialize configs to false if they are missing
231+
if (this._job_config.model_plot_config === undefined) {
232+
this._job_config.model_plot_config = {};
233+
}
234+
if (this._job_config.model_plot_config.enabled === undefined) {
235+
this._job_config.model_plot_config.enabled = false;
236+
}
237+
if (this._job_config.model_plot_config.annotations_enabled === undefined) {
238+
this._job_config.model_plot_config.annotations_enabled = false;
236239
}
237240
}
238241

242+
public set modelPlot(enable: boolean) {
243+
this._initModelPlotConfig();
244+
this._job_config.model_plot_config!.enabled = enable;
245+
}
239246
public get modelPlot() {
240247
return (
241248
this._job_config.model_plot_config !== undefined &&
242249
this._job_config.model_plot_config.enabled === true
243250
);
244251
}
245252

253+
public set modelChangeAnnotations(enable: boolean) {
254+
this._initModelPlotConfig();
255+
this._job_config.model_plot_config!.annotations_enabled = enable;
256+
}
257+
258+
public get modelChangeAnnotations() {
259+
return this._job_config.model_plot_config?.annotations_enabled === true;
260+
}
261+
246262
public set useDedicatedIndex(enable: boolean) {
247263
this._useDedicatedIndex = enable;
248264
if (enable) {

0 commit comments

Comments
 (0)