{
+ // Update EsQuery in Redux to be used in FilterGroup
+ const searchDSL: string = filterQueryString
+ ? JSON.stringify(
+ esKuery.toElasticsearchQuery(esKuery.fromKueryExpression(filterQueryString), indexPattern)
+ )
+ : '';
+ store.dispatch(setEsKueryString(searchDSL));
+};
+
+const getKueryString = (urlFilters: string): string => {
+ let kueryString = '';
+ // We are using try/catch here because this is user entered value
+ // and JSON.parse and stringifyKueries can have hard time parsing
+ // all possible scenarios, we can safely ignore if we can't parse them
+ try {
+ if (urlFilters !== '') {
+ const filterMap = new Map>(JSON.parse(urlFilters));
+ kueryString = stringifyKueries(filterMap);
+ }
+ } catch {
+ kueryString = '';
+ }
+ return kueryString;
+};
+
+export const useUpdateKueryString = (
+ indexPattern: IIndexPattern,
+ filterQueryString = '',
+ urlFilters: string
+): [string?, Error?] => {
+ const kueryString = getKueryString(urlFilters);
+
+ const combinedFilterString = combineFiltersAndUserSearch(filterQueryString, kueryString);
+
+ let esFilters: string | undefined;
+ // this try catch is necessary to evaluate user input in kuery bar,
+ // this error will be actually shown in UI for user to see
+ try {
+ if ((filterQueryString || urlFilters) && indexPattern) {
+ const ast = esKuery.fromKueryExpression(combinedFilterString);
+
+ const elasticsearchQuery = esKuery.toElasticsearchQuery(ast, indexPattern);
+
+ esFilters = JSON.stringify(elasticsearchQuery);
+
+ updateEsQueryForFilterGroup(filterQueryString, indexPattern);
+ }
+ return [esFilters];
+ } catch (err) {
+ return [urlFilters, err];
+ }
+};
diff --git a/x-pack/legacy/plugins/uptime/public/hooks/use_index_pattern.ts b/x-pack/legacy/plugins/uptime/public/hooks/use_index_pattern.ts
deleted file mode 100644
index f2b586b27dba69..00000000000000
--- a/x-pack/legacy/plugins/uptime/public/hooks/use_index_pattern.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { useEffect, Dispatch } from 'react';
-import { useKibana } from '../../../../../../src/plugins/kibana_react/public';
-
-export const useIndexPattern = (setIndexPattern: Dispatch) => {
- const core = useKibana();
- useEffect(() => {
- const fetch = core.services.http?.fetch;
- async function getIndexPattern() {
- if (!fetch) throw new Error('Http core services are not defined');
- setIndexPattern(await fetch('/api/uptime/index_pattern', { method: 'GET' }));
- }
- getIndexPattern();
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [core.services.http]);
-};
diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap b/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap
deleted file mode 100644
index bc02e1054b6f77..00000000000000
--- a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap
+++ /dev/null
@@ -1,19 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`toStaticIndexPattern provides the required fields 1`] = `
-Object {
- "attributes": Object {
- "fields": "[{\\"name\\":\\"@timestamp\\",\\"type\\":\\"date\\",\\"scripted\\":false,\\"searchable\\":true}]",
- },
- "fields": Array [
- Object {
- "name": "@timestamp",
- "scripted": false,
- "searchable": true,
- "type": "date",
- },
- ],
- "id": "foo",
- "title": "foo",
-}
-`;
diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts
deleted file mode 100644
index c8015a678c726a..00000000000000
--- a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { toStaticIndexPattern } from '../to_static_index_pattern';
-
-describe('toStaticIndexPattern', () => {
- it('provides the required fields', () => {
- const pattern = {
- attributes: {
- fields: '[{"name":"@timestamp","type":"date","scripted":false,"searchable":true}]',
- },
- id: 'foo',
- };
- expect(toStaticIndexPattern(pattern)).toMatchSnapshot();
- });
-});
diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts
index f3dfbb7d3b5297..45aff24f0449e5 100644
--- a/x-pack/legacy/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts
+++ b/x-pack/legacy/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts
@@ -5,6 +5,9 @@
*/
export const combineFiltersAndUserSearch = (filters: string, search: string) => {
+ if (!filters && !search) {
+ return '';
+ }
if (!filters) return search;
if (!search) return filters;
return `(${filters}) and (${search})`;
diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/index.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/index.ts
index ced06ce7a1d7b6..ef191ce32e5321 100644
--- a/x-pack/legacy/plugins/uptime/public/lib/helper/index.ts
+++ b/x-pack/legacy/plugins/uptime/public/lib/helper/index.ts
@@ -12,5 +12,4 @@ export { getChartDateLabel } from './charts';
export { parameterizeValues } from './parameterize_values';
export { seriesHasDownValues } from './series_has_down_values';
export { stringifyKueries } from './stringify_kueries';
-export { toStaticIndexPattern } from './to_static_index_pattern';
export { UptimeUrlParams, getSupportedUrlParams } from './url_params';
diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/to_static_index_pattern.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/to_static_index_pattern.ts
deleted file mode 100644
index b8a12c1e578e39..00000000000000
--- a/x-pack/legacy/plugins/uptime/public/lib/helper/to_static_index_pattern.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-export const toStaticIndexPattern = (indexPattern: any) => ({
- ...indexPattern,
- fields: JSON.parse(indexPattern.attributes.fields),
- title: indexPattern.id,
-});
diff --git a/x-pack/legacy/plugins/uptime/public/pages/index.ts b/x-pack/legacy/plugins/uptime/public/pages/index.ts
index a96be42eb0deea..17f083ca023ed4 100644
--- a/x-pack/legacy/plugins/uptime/public/pages/index.ts
+++ b/x-pack/legacy/plugins/uptime/public/pages/index.ts
@@ -5,6 +5,6 @@
*/
export { MonitorPage } from './monitor';
-export { OverviewPage } from './overview';
export { NotFoundPage } from './not_found';
export { PageHeader } from './page_header';
+export { OverviewPage } from '../components/connected/';
diff --git a/x-pack/legacy/plugins/uptime/public/pages/overview.tsx b/x-pack/legacy/plugins/uptime/public/pages/overview.tsx
index b9c2284edb0cf6..0f6195c5f4c66e 100644
--- a/x-pack/legacy/plugins/uptime/public/pages/overview.tsx
+++ b/x-pack/legacy/plugins/uptime/public/pages/overview.tsx
@@ -5,30 +5,28 @@
*/
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
-import React, { Fragment, useContext, useState } from 'react';
+import React, { useContext } from 'react';
import styled from 'styled-components';
import {
EmptyState,
- FilterGroup,
- KueryBar,
MonitorList,
OverviewPageParsingErrorCallout,
StatusPanel,
} from '../components/functional';
import { UMUpdateBreadcrumbs } from '../lib/lib';
-import { useIndexPattern, useUrlParams, useUptimeTelemetry, UptimePage } from '../hooks';
+import { useUrlParams, useUptimeTelemetry, UptimePage } from '../hooks';
import { stringifyUrlParams } from '../lib/helper/stringify_url_params';
import { useTrackPageview } from '../../../infra/public';
-import { combineFiltersAndUserSearch, stringifyKueries, toStaticIndexPattern } from '../lib/helper';
-import { store } from '../state';
-import { setEsKueryString } from '../state/actions';
import { PageHeader } from './page_header';
-import { esKuery, DataPublicPluginStart } from '../../../../../../src/plugins/data/public';
-import { UptimeThemeContext } from '../contexts/uptime_theme_context';
+import { DataPublicPluginStart, IIndexPattern } from '../../../../../../src/plugins/data/public';
+import { UptimeThemeContext } from '../contexts';
+import { FilterGroup, KueryBar } from '../components/connected';
+import { useUpdateKueryString } from '../hooks';
interface OverviewPageProps {
autocomplete: DataPublicPluginStart['autocomplete'];
setBreadcrumbs: UMUpdateBreadcrumbs;
+ indexPattern: IIndexPattern;
}
type Props = OverviewPageProps;
@@ -42,72 +40,37 @@ const EuiFlexItemStyled = styled(EuiFlexItem)`
}
`;
-export const OverviewPage = ({ autocomplete, setBreadcrumbs }: Props) => {
+export const OverviewPageComponent = ({ autocomplete, setBreadcrumbs, indexPattern }: Props) => {
const { colors } = useContext(UptimeThemeContext);
- const [getUrlParams, updateUrl] = useUrlParams();
+ const [getUrlParams] = useUrlParams();
const { absoluteDateRangeStart, absoluteDateRangeEnd, ...params } = getUrlParams();
const {
dateRangeStart,
dateRangeEnd,
- search,
pagination,
statusFilter,
+ search,
filters: urlFilters,
} = params;
- const [indexPattern, setIndexPattern] = useState(undefined);
+
useUptimeTelemetry(UptimePage.Overview);
- useIndexPattern(setIndexPattern);
useTrackPageview({ app: 'uptime', path: 'overview' });
useTrackPageview({ app: 'uptime', path: 'overview', delay: 15000 });
- let error: any;
- let kueryString: string = '';
- try {
- if (urlFilters !== '') {
- const filterMap = new Map>(JSON.parse(urlFilters));
- kueryString = stringifyKueries(filterMap);
- }
- } catch {
- kueryString = '';
- }
-
- const filterQueryString = search || '';
- let filters: any | undefined;
- try {
- if (filterQueryString || urlFilters) {
- if (indexPattern) {
- const staticIndexPattern = toStaticIndexPattern(indexPattern);
- const combinedFilterString = combineFiltersAndUserSearch(filterQueryString, kueryString);
- const ast = esKuery.fromKueryExpression(combinedFilterString);
- const elasticsearchQuery = esKuery.toElasticsearchQuery(ast, staticIndexPattern);
- filters = JSON.stringify(elasticsearchQuery);
- const searchDSL: string = filterQueryString
- ? JSON.stringify(
- esKuery.toElasticsearchQuery(
- esKuery.fromKueryExpression(filterQueryString),
- staticIndexPattern
- )
- )
- : '';
- store.dispatch(setEsKueryString(searchDSL));
- }
- }
- } catch (e) {
- error = e;
- }
+ const [esFilters, error] = useUpdateKueryString(indexPattern, search, urlFilters);
const sharedProps = {
dateRangeStart,
dateRangeEnd,
- filters,
statusFilter,
+ filters: esFilters,
};
const linkParameters = stringifyUrlParams(params, true);
return (
-
+ <>
@@ -115,15 +78,7 @@ export const OverviewPage = ({ autocomplete, setBreadcrumbs }: Props) => {
- {
- if (urlFilters !== filtersKuery) {
- updateUrl({ filters: filtersKuery, pagination: '' });
- }
- }}
- />
+
{error && }
@@ -133,7 +88,7 @@ export const OverviewPage = ({ autocomplete, setBreadcrumbs }: Props) => {
absoluteDateRangeEnd={absoluteDateRangeEnd}
dateRangeStart={dateRangeStart}
dateRangeEnd={dateRangeEnd}
- filters={filters}
+ filters={esFilters}
statusFilter={statusFilter}
/>
@@ -141,7 +96,7 @@ export const OverviewPage = ({ autocomplete, setBreadcrumbs }: Props) => {
absoluteStartDate={absoluteDateRangeStart}
absoluteEndDate={absoluteDateRangeEnd}
dangerColor={colors.danger}
- hasActiveFilters={!!filters}
+ hasActiveFilters={!!esFilters}
implementsCustomErrorState={true}
linkParameters={linkParameters}
successColor={colors.success}
@@ -151,6 +106,6 @@ export const OverviewPage = ({ autocomplete, setBreadcrumbs }: Props) => {
}}
/>
-
+ >
);
};
diff --git a/x-pack/legacy/plugins/uptime/public/routes.tsx b/x-pack/legacy/plugins/uptime/public/routes.tsx
index 07bba5163922e6..c318a82ab7f199 100644
--- a/x-pack/legacy/plugins/uptime/public/routes.tsx
+++ b/x-pack/legacy/plugins/uptime/public/routes.tsx
@@ -6,7 +6,7 @@
import React, { FC } from 'react';
import { Route, Switch } from 'react-router-dom';
-import { MonitorPage, OverviewPage, NotFoundPage } from './pages';
+import { MonitorPage, NotFoundPage, OverviewPage } from './pages';
import { DataPublicPluginStart } from '../../../../../src/plugins/data/public';
import { UMUpdateBreadcrumbs } from './lib/lib';
diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/index.ts b/x-pack/legacy/plugins/uptime/public/state/actions/index.ts
index 6758006914ab8d..df707584bd844b 100644
--- a/x-pack/legacy/plugins/uptime/public/state/actions/index.ts
+++ b/x-pack/legacy/plugins/uptime/public/state/actions/index.ts
@@ -8,4 +8,5 @@ export * from './overview_filters';
export * from './snapshot';
export * from './ui';
export * from './monitor_status';
+export * from './index_patternts';
export * from './ping';
diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/index_patternts.ts b/x-pack/legacy/plugins/uptime/public/state/actions/index_patternts.ts
new file mode 100644
index 00000000000000..f52dac805a199e
--- /dev/null
+++ b/x-pack/legacy/plugins/uptime/public/state/actions/index_patternts.ts
@@ -0,0 +1,12 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { createAction } from 'redux-actions';
+import { QueryParams } from './types';
+
+export const getIndexPattern = createAction('GET_INDEX_PATTERN');
+export const getIndexPatternSuccess = createAction('GET_INDEX_PATTERN_SUCCESS');
+export const getIndexPatternFail = createAction('GET_INDEX_PATTERN_FAIL');
diff --git a/x-pack/legacy/plugins/uptime/public/state/api/index.ts b/x-pack/legacy/plugins/uptime/public/state/api/index.ts
index be79317dc97c2a..2d206388323359 100644
--- a/x-pack/legacy/plugins/uptime/public/state/api/index.ts
+++ b/x-pack/legacy/plugins/uptime/public/state/api/index.ts
@@ -8,4 +8,5 @@ export * from './monitor';
export * from './overview_filters';
export * from './snapshot';
export * from './monitor_status';
+export * from './index_pattern';
export * from './ping';
diff --git a/x-pack/legacy/plugins/uptime/public/state/api/index_pattern.ts b/x-pack/legacy/plugins/uptime/public/state/api/index_pattern.ts
new file mode 100644
index 00000000000000..2669376d728ab6
--- /dev/null
+++ b/x-pack/legacy/plugins/uptime/public/state/api/index_pattern.ts
@@ -0,0 +1,21 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { getApiPath } from '../../lib/helper';
+
+interface APIParams {
+ basePath: string;
+}
+
+export const fetchIndexPattern = async ({ basePath }: APIParams) => {
+ const url = getApiPath(`/api/uptime/index_pattern`, basePath);
+
+ const response = await fetch(url);
+ if (!response.ok) {
+ throw new Error(response.statusText);
+ }
+ return await response.json();
+};
diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/index.ts b/x-pack/legacy/plugins/uptime/public/state/effects/index.ts
index 21d4f7a66ad67d..f809454cefb39f 100644
--- a/x-pack/legacy/plugins/uptime/public/state/effects/index.ts
+++ b/x-pack/legacy/plugins/uptime/public/state/effects/index.ts
@@ -9,6 +9,7 @@ import { fetchMonitorDetailsEffect } from './monitor';
import { fetchOverviewFiltersEffect } from './overview_filters';
import { fetchSnapshotCountEffect } from './snapshot';
import { fetchMonitorStatusEffect } from './monitor_status';
+import { fetchIndexPatternEffect } from './index_pattern';
import { fetchPingHistogramEffect } from './ping';
export function* rootEffect() {
@@ -16,5 +17,6 @@ export function* rootEffect() {
yield fork(fetchSnapshotCountEffect);
yield fork(fetchOverviewFiltersEffect);
yield fork(fetchMonitorStatusEffect);
+ yield fork(fetchIndexPatternEffect);
yield fork(fetchPingHistogramEffect);
}
diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/index_pattern.ts b/x-pack/legacy/plugins/uptime/public/state/effects/index_pattern.ts
new file mode 100644
index 00000000000000..a6f9256d5ccd96
--- /dev/null
+++ b/x-pack/legacy/plugins/uptime/public/state/effects/index_pattern.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { takeLatest } from 'redux-saga/effects';
+import { getIndexPattern, getIndexPatternSuccess, getIndexPatternFail } from '../actions';
+import { fetchIndexPattern } from '../api';
+import { fetchEffectFactory } from './fetch_effect';
+
+export function* fetchIndexPatternEffect() {
+ yield takeLatest(
+ getIndexPattern,
+ fetchEffectFactory(fetchIndexPattern, getIndexPatternSuccess, getIndexPatternFail)
+ );
+}
diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts b/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts
index c80ada4f63182f..842cb1e9371082 100644
--- a/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts
+++ b/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts
@@ -10,6 +10,7 @@ import { overviewFiltersReducer } from './overview_filters';
import { snapshotReducer } from './snapshot';
import { uiReducer } from './ui';
import { monitorStatusReducer } from './monitor_status';
+import { indexPatternReducer } from './index_pattern';
import { pingReducer } from './ping';
export const rootReducer = combineReducers({
@@ -18,5 +19,6 @@ export const rootReducer = combineReducers({
snapshot: snapshotReducer,
ui: uiReducer,
monitorStatus: monitorStatusReducer,
+ indexPattern: indexPatternReducer,
ping: pingReducer,
});
diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/index_pattern.ts b/x-pack/legacy/plugins/uptime/public/state/reducers/index_pattern.ts
new file mode 100644
index 00000000000000..dff043f81b95c2
--- /dev/null
+++ b/x-pack/legacy/plugins/uptime/public/state/reducers/index_pattern.ts
@@ -0,0 +1,41 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+import { handleActions, Action } from 'redux-actions';
+import { getIndexPattern, getIndexPatternSuccess, getIndexPatternFail } from '../actions';
+
+export interface IndexPatternState {
+ index_pattern: any;
+ errors: any[];
+ loading: boolean;
+}
+
+const initialState: IndexPatternState = {
+ index_pattern: null,
+ loading: false,
+ errors: [],
+};
+
+export const indexPatternReducer = handleActions(
+ {
+ [String(getIndexPattern)]: state => ({
+ ...state,
+ loading: true,
+ }),
+
+ [String(getIndexPatternSuccess)]: (state, action: Action) => ({
+ ...state,
+ loading: false,
+ index_pattern: { ...action.payload },
+ }),
+
+ [String(getIndexPatternFail)]: (state, action: Action) => ({
+ ...state,
+ errors: [...state.errors, action.payload],
+ loading: false,
+ }),
+ },
+ initialState
+);
diff --git a/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts b/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts
index 5e3bf95d812922..2e27431a5ff14c 100644
--- a/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts
+++ b/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts
@@ -45,6 +45,11 @@ describe('state selectors', () => {
monitor: null,
loading: false,
},
+ indexPattern: {
+ index_pattern: null,
+ loading: false,
+ errors: [],
+ },
ping: {
pingHistogram: null,
loading: false,
diff --git a/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts b/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts
index 0066241dcc2175..fe6a7a1b7eade5 100644
--- a/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts
+++ b/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts
@@ -29,6 +29,10 @@ export const selectMonitorStatus = (state: AppState) => {
return state.monitorStatus.status;
};
+export const selectIndexPattern = ({ indexPattern }: AppState) => {
+ return indexPattern.index_pattern;
+};
+
export const selectPingHistogram = ({ ping, ui }: AppState) => {
return { data: ping.pingHistogram, loading: ping.loading, lastRefresh: ui.lastRefresh };
};
diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts
index 2f72081a709884..fb2052bb4c87f1 100644
--- a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts
+++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts
@@ -8,26 +8,12 @@ import { GraphQLSchema } from 'graphql';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import {
SavedObjectsLegacyService,
- RequestHandler,
IRouter,
CallAPIOptions,
SavedObjectsClientContract,
} from 'src/core/server';
-import { ObjectType } from '@kbn/config-schema';
import { UMKibanaRoute } from '../../../rest_api';
-export interface UMFrameworkRouteOptions<
- P extends ObjectType,
- Q extends ObjectType,
- B extends ObjectType
-> {
- path: string;
- method: string;
- handler: RequestHandler
;
- config?: any;
- validate: any;
-}
-
type APICaller = (
endpoint: string,
clientParams: Record,
diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/index.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/index.ts
index f5ff3b8c62ba99..fbef70f106dd80 100644
--- a/x-pack/legacy/plugins/uptime/server/lib/adapters/index.ts
+++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/index.ts
@@ -8,5 +8,5 @@ export * from './framework';
export * from './monitor_states';
export * from './monitors';
export * from './pings';
-export * from './saved_objects';
+export * from './stub_index_pattern';
export * from './telemetry';
diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json b/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json
deleted file mode 100644
index 444c7510c6a6d2..00000000000000
--- a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "attributes": {
- "fields": "[{\"name\":\"@timestamp\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"esTypes\":[\"_type\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"agent.ephemeral_id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"agent.hostname\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"agent.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"agent.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"agent.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"agent.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.address\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.domain\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.geo.city_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.geo.continent_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.geo.country_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.geo.country_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.geo.location\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.geo.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.geo.region_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.geo.region_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.mac\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.packets\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.port\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.user.email\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.user.full_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.user.group.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.user.group.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.user.hash\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.user.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"client.user.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.account.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.availability_zone\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.image.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.instance.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.instance.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.machine.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.project.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.provider\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"cloud.region\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"container.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"container.image.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"container.image.tag\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"container.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"container.runtime\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.address\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.domain\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.geo.city_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.geo.continent_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.geo.country_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.geo.country_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.geo.location\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.geo.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.geo.region_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.geo.region_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.mac\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.packets\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.port\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.user.email\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.user.full_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.user.group.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.user.group.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.user.hash\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.user.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"destination.user.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"ecs.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"error.code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"error.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"error.message\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"error.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.action\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.category\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.created\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.dataset\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.duration\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.end\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.hash\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.kind\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.module\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.original\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.outcome\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.risk_score\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.risk_score_norm\",\"type\":\"number\",\"esTypes\":[\"float\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.severity\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.start\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.timezone\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"event.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.ctime\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.device\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.extension\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.gid\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.group\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.inode\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.mode\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.mtime\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.owner\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.path\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.size\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.target_path\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"file.uid\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.city_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.continent_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.country_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.country_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.location\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.region_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.region_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"group.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"group.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.architecture\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.containerized\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.geo.city_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.geo.continent_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.geo.country_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.geo.country_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.geo.location\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.geo.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.geo.region_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.geo.region_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.hostname\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.mac\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.os.build\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.os.codename\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.os.family\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.os.full\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.os.kernel\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.os.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.os.platform\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.os.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.user.email\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.user.full_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.user.group.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.user.group.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.user.hash\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.user.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"host.user.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.request.body.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.request.body.content\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.request.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.request.method\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.request.referrer\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.response.body.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.response.body.content\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.response.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.response.status_code\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.rtt.content.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.rtt.response_header.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.rtt.total.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.rtt.validate.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.rtt.validate_body.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.rtt.write_request.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"http.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"icmp.requests\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"icmp.rtt.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"jolokia.agent.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"jolokia.agent.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"jolokia.secured\",\"type\":\"boolean\",\"esTypes\":[\"boolean\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"jolokia.server.product\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"jolokia.server.vendor\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"jolokia.server.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"jolokia.url\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.container.image\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.container.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.deployment.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.namespace\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.node.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.pod.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.pod.uid\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.replicaset.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"kubernetes.statefulset.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"log.level\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"log.original\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"message\",\"type\":\"string\",\"esTypes\":[\"text\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"monitor.check_group\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"monitor.duration.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"monitor.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"monitor.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"monitor.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"monitor.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.application\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.community_id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.direction\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.forwarded_ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.iana_number\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.packets\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.protocol\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.transport\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"network.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.geo.city_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.geo.continent_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.geo.country_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.geo.country_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.geo.location\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.geo.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.geo.region_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.geo.region_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.hostname\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.mac\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.os.family\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.os.full\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.os.kernel\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.os.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.os.platform\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.os.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.serial_number\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.vendor\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"observer.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"organization.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"organization.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"os.family\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"os.full\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"os.kernel\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"os.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"os.platform\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"os.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.args\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.executable\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.pid\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.ppid\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.start\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.thread.id\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.title\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"process.working_directory\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"related.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resolve.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"resolve.rtt.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.address\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.domain\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.geo.city_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.geo.continent_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.geo.country_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.geo.country_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.geo.location\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.geo.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.geo.region_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.geo.region_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.mac\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.packets\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.port\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.user.email\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.user.full_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.user.group.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.user.group.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.user.hash\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.user.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"server.user.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"service.ephemeral_id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"service.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"service.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"service.state\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"service.type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"service.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"socks5.rtt.connect.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.address\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.domain\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.geo.city_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.geo.continent_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.geo.country_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.geo.country_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.geo.location\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.geo.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.geo.region_iso_code\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.geo.region_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.mac\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.packets\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.port\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.user.email\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.user.full_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.user.group.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.user.group.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.user.hash\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.user.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"source.user.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"summary.down\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"summary.up\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tags\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tcp.rtt.connect.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tcp.rtt.validate.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"timeseries.instance\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tls.certificate_not_valid_after\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tls.certificate_not_valid_before\",\"type\":\"date\",\"esTypes\":[\"date\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"tls.rtt.handshake.us\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.domain\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.fragment\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.full\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.original\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.password\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.path\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.port\",\"type\":\"number\",\"esTypes\":[\"long\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.query\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.scheme\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url.username\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user.email\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user.full_name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user.group.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user.group.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user.hash\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user.id\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.device.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.original\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.os.family\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.os.full\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.os.kernel\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.os.name\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.os.platform\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.os.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"user_agent.version\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]",
- "timeFieldName": "@timestamp",
- "title": "heartbeat-8*"
- },
- "id": "heartbeat-8*",
- "migrationVersion": { "index-pattern": "6.5.0" },
- "references": [],
- "type": "index-pattern",
- "updated_at": "2019-08-20T17:45:34.286Z",
- "version": "1"
-}
diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts
deleted file mode 100644
index 7628c5bac0660f..00000000000000
--- a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { UMSavedObjectsAdapter } from './types';
-import uptimeIndexPattern from './heartbeat_index_pattern.json';
-
-export const savedObjectsAdapter: UMSavedObjectsAdapter = {
- getUptimeIndexPattern: async client => {
- try {
- return await client.get('index-pattern', uptimeIndexPattern.id);
- } catch (error) {
- return await client.create(
- 'index-pattern',
- {
- ...uptimeIndexPattern.attributes,
- title: 'UptimeIndexPattern',
- },
- { id: uptimeIndexPattern.id, overwrite: false }
- );
- }
- },
-};
diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/types.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/types.ts
deleted file mode 100644
index 0fef1e1428e97b..00000000000000
--- a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/types.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { UMSavedObjectsQueryFn } from '../framework';
-
-export interface UMSavedObjectsAdapter {
- getUptimeIndexPattern: UMSavedObjectsQueryFn;
-}
diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/index.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/stub_index_pattern/index.ts
similarity index 67%
rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/index.ts
rename to x-pack/legacy/plugins/uptime/server/lib/adapters/stub_index_pattern/index.ts
index bd86daba1bcb62..4ef6e3fa8a6bdf 100644
--- a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/index.ts
+++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/stub_index_pattern/index.ts
@@ -4,5 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
-export { savedObjectsAdapter } from './kibana_saved_objects_adapter';
-export { UMSavedObjectsAdapter } from './types';
+export { StubIndexPatternAdapter, stubIndexPatternAdapter } from './stub_index_pattern';
diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/stub_index_pattern/stub_index_pattern.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/stub_index_pattern/stub_index_pattern.ts
new file mode 100644
index 00000000000000..49ec86af250405
--- /dev/null
+++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/stub_index_pattern/stub_index_pattern.ts
@@ -0,0 +1,54 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { APICaller } from 'kibana/server';
+import {
+ IndexPatternsFetcher,
+ IIndexPattern,
+} from '../../../../../../../../src/plugins/data/server';
+import { INDEX_NAMES } from '../../../../common/constants';
+import { UMElasticsearchQueryFn } from '../framework';
+
+export interface StubIndexPatternAdapter {
+ getUptimeIndexPattern: UMElasticsearchQueryFn;
+}
+
+export const stubIndexPatternAdapter: StubIndexPatternAdapter = {
+ getUptimeIndexPattern: async callES => {
+ const indexPatternsFetcher = new IndexPatternsFetcher((...rest: Parameters) =>
+ callES(...rest)
+ );
+
+ // Since `getDynamicIndexPattern` is called in setup_request (and thus by every endpoint)
+ // and since `getFieldsForWildcard` will throw if the specified indices don't exist,
+ // we have to catch errors here to avoid all endpoints returning 500 for users without APM data
+ // (would be a bad first time experience)
+ try {
+ const fields = await indexPatternsFetcher.getFieldsForWildcard({
+ pattern: INDEX_NAMES.HEARTBEAT,
+ });
+
+ const indexPattern: IIndexPattern = {
+ fields,
+ title: INDEX_NAMES.HEARTBEAT,
+ };
+
+ return indexPattern;
+ } catch (e) {
+ const notExists = e.output?.statusCode === 404;
+ if (notExists) {
+ // eslint-disable-next-line no-console
+ console.error(
+ `Could not get dynamic index pattern because indices "${INDEX_NAMES.HEARTBEAT}" don't exist`
+ );
+ return;
+ }
+
+ // re-throw
+ throw e;
+ }
+ },
+};
diff --git a/x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts b/x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts
index cc11bf90da5f3b..b44a890de3819a 100644
--- a/x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts
+++ b/x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts
@@ -10,7 +10,7 @@ import { elasticsearchPingsAdapter } from '../adapters/pings';
import { licenseCheck } from '../domains';
import { UMDomainLibs, UMServerLibs } from '../lib';
import { elasticsearchMonitorStatesAdapter } from '../adapters/monitor_states';
-import { savedObjectsAdapter } from '../adapters/saved_objects';
+import { stubIndexPatternAdapter } from '../adapters/stub_index_pattern';
import { UptimeCorePlugins, UptimeCoreSetup } from '../adapters/framework';
export function compose(server: UptimeCoreSetup, plugins: UptimeCorePlugins): UMServerLibs {
@@ -21,7 +21,7 @@ export function compose(server: UptimeCoreSetup, plugins: UptimeCorePlugins): UM
monitors: elasticsearchMonitorsAdapter,
monitorStates: elasticsearchMonitorStatesAdapter,
pings: elasticsearchPingsAdapter,
- savedObjects: savedObjectsAdapter,
+ stubIndexPattern: stubIndexPatternAdapter,
};
return {
diff --git a/x-pack/legacy/plugins/uptime/server/lib/lib.ts b/x-pack/legacy/plugins/uptime/server/lib/lib.ts
index da87c3ebfe3017..e5ab9940d482d4 100644
--- a/x-pack/legacy/plugins/uptime/server/lib/lib.ts
+++ b/x-pack/legacy/plugins/uptime/server/lib/lib.ts
@@ -9,7 +9,7 @@ import {
UMMonitorsAdapter,
UMMonitorStatesAdapter,
UMPingsAdapter,
- UMSavedObjectsAdapter,
+ StubIndexPatternAdapter,
} from './adapters';
import { UMLicenseCheck } from './domains';
@@ -18,7 +18,7 @@ export interface UMDomainLibs {
monitors: UMMonitorsAdapter;
monitorStates: UMMonitorStatesAdapter;
pings: UMPingsAdapter;
- savedObjects: UMSavedObjectsAdapter;
+ stubIndexPattern: StubIndexPatternAdapter;
}
export interface UMServerLibs extends UMDomainLibs {
diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts b/x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts
index f061307807a42d..cee8eaf3f9caeb 100644
--- a/x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts
+++ b/x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts
@@ -14,11 +14,11 @@ export const createGetIndexPatternRoute: UMRestApiRouteFactory = (libs: UMServer
options: {
tags: ['access:uptime'],
},
- handler: async ({ savedObjectsClient: client }, _context, _request, response): Promise => {
+ handler: async ({ callES }, _context, _request, response): Promise => {
try {
return response.ok({
body: {
- ...(await libs.savedObjects.getUptimeIndexPattern(client, undefined)),
+ ...(await libs.stubIndexPattern.getUptimeIndexPattern(callES)),
},
});
} catch (e) {
From fb334ef56662e56ea0e9b68331914eccc5e96afe Mon Sep 17 00:00:00 2001
From: Melissa Alvarez
Date: Thu, 30 Jan 2020 08:26:16 -0500
Subject: [PATCH 10/69] [ML] New Platform server shim: update calendar routes
to use new platform router (#56264)
* migrate calendar routes to NP
* add proper types for calendars and events
* set actual client in constructor so isLegacy is not stored
* remove unnecessary comments
* fix calendar schema for missing calendar_id and event_id properties
---
...alendar_manager.js => calendar_manager.ts} | 88 ++++++----
.../{event_manager.js => event_manager.ts} | 39 +++--
.../models/calendar/{index.js => index.ts} | 2 +-
.../ml/server/models/job_service/groups.js | 2 +-
.../ml/server/models/job_service/jobs.js | 2 +-
.../server/new_platform/calendars_schema.ts | 25 +++
.../plugins/ml/server/new_platform/plugin.ts | 2 -
.../plugins/ml/server/routes/calendars.js | 110 -------------
.../plugins/ml/server/routes/calendars.ts | 155 ++++++++++++++++++
9 files changed, 268 insertions(+), 157 deletions(-)
rename x-pack/legacy/plugins/ml/server/models/calendar/{calendar_manager.js => calendar_manager.ts} (53%)
rename x-pack/legacy/plugins/ml/server/models/calendar/{event_manager.js => event_manager.ts} (51%)
rename x-pack/legacy/plugins/ml/server/models/calendar/{index.js => index.ts} (75%)
create mode 100644 x-pack/legacy/plugins/ml/server/new_platform/calendars_schema.ts
delete mode 100644 x-pack/legacy/plugins/ml/server/routes/calendars.js
create mode 100644 x-pack/legacy/plugins/ml/server/routes/calendars.ts
diff --git a/x-pack/legacy/plugins/ml/server/models/calendar/calendar_manager.js b/x-pack/legacy/plugins/ml/server/models/calendar/calendar_manager.ts
similarity index 53%
rename from x-pack/legacy/plugins/ml/server/models/calendar/calendar_manager.js
rename to x-pack/legacy/plugins/ml/server/models/calendar/calendar_manager.ts
index e74a81e92420f6..2487943b5efc07 100644
--- a/x-pack/legacy/plugins/ml/server/models/calendar/calendar_manager.js
+++ b/x-pack/legacy/plugins/ml/server/models/calendar/calendar_manager.ts
@@ -4,23 +4,44 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import _ from 'lodash';
+import { difference } from 'lodash';
import Boom from 'boom';
-import { EventManager } from './event_manager';
+import { EventManager, CalendarEvent } from './event_manager';
+
+interface BasicCalendar {
+ job_ids: string[];
+ description?: string;
+ events: CalendarEvent[];
+}
+
+export interface Calendar extends BasicCalendar {
+ calendar_id: string;
+}
+
+export interface FormCalendar extends BasicCalendar {
+ calendarId: string;
+}
export class CalendarManager {
- constructor(callWithRequest) {
- this.callWithRequest = callWithRequest;
- this.eventManager = new EventManager(callWithRequest);
+ private _client: any;
+ private _eventManager: any;
+
+ constructor(isLegacy: boolean, client: any) {
+ const actualClient = isLegacy === true ? client : client.ml!.mlClient.callAsCurrentUser;
+ this._client = actualClient;
+ this._eventManager = new EventManager(actualClient);
}
- async getCalendar(calendarId) {
+ async getCalendar(calendarId: string) {
try {
- const resp = await this.callWithRequest('ml.calendars', { calendarId });
+ const resp = await this._client('ml.calendars', {
+ calendarId,
+ });
+
const calendars = resp.calendars;
if (calendars.length) {
const calendar = calendars[0];
- calendar.events = await this.eventManager.getCalendarEvents(calendarId);
+ calendar.events = await this._eventManager.getCalendarEvents(calendarId);
return calendar;
} else {
throw Boom.notFound(`Calendar with the id "${calendarId}" not found`);
@@ -32,9 +53,10 @@ export class CalendarManager {
async getAllCalendars() {
try {
- const calendarsResp = await this.callWithRequest('ml.calendars');
- const events = await this.eventManager.getAllEvents();
- const calendars = calendarsResp.calendars;
+ const calendarsResp = await this._client('ml.calendars');
+
+ const events: CalendarEvent[] = await this._eventManager.getAllEvents();
+ const calendars: Calendar[] = calendarsResp.calendars;
calendars.forEach(cal => (cal.events = []));
// loop events and combine with related calendars
@@ -55,24 +77,28 @@ export class CalendarManager {
* @param calendarIds
* @returns {Promise<*>}
*/
- async getCalendarsByIds(calendarIds) {
+ async getCalendarsByIds(calendarIds: string) {
try {
- const calendars = await this.getAllCalendars();
+ const calendars: Calendar[] = await this.getAllCalendars();
return calendars.filter(calendar => calendarIds.includes(calendar.calendar_id));
} catch (error) {
throw Boom.badRequest(error);
}
}
- async newCalendar(calendar) {
+ async newCalendar(calendar: FormCalendar) {
const calendarId = calendar.calendarId;
const events = calendar.events;
delete calendar.calendarId;
delete calendar.events;
try {
- await this.callWithRequest('ml.addCalendar', { calendarId, body: calendar });
+ await this._client('ml.addCalendar', {
+ calendarId,
+ body: calendar,
+ });
+
if (events.length) {
- await this.eventManager.addEvents(calendarId, events);
+ await this._eventManager.addEvents(calendarId, events);
}
// return the newly created calendar
@@ -82,38 +108,38 @@ export class CalendarManager {
}
}
- async updateCalendar(calendarId, calendar) {
- const origCalendar = await this.getCalendar(calendarId);
+ async updateCalendar(calendarId: string, calendar: Calendar) {
+ const origCalendar: Calendar = await this.getCalendar(calendarId);
try {
// update job_ids
- const jobsToAdd = _.difference(calendar.job_ids, origCalendar.job_ids);
- const jobsToRemove = _.difference(origCalendar.job_ids, calendar.job_ids);
+ const jobsToAdd = difference(calendar.job_ids, origCalendar.job_ids);
+ const jobsToRemove = difference(origCalendar.job_ids, calendar.job_ids);
// workout the differences between the original events list and the new one
// if an event has no event_id, it must be new
const eventsToAdd = calendar.events.filter(
- event => origCalendar.events.find(e => this.eventManager.isEqual(e, event)) === undefined
+ event => origCalendar.events.find(e => this._eventManager.isEqual(e, event)) === undefined
);
// if an event in the original calendar cannot be found, it must have been deleted
- const eventsToRemove = origCalendar.events.filter(
- event => calendar.events.find(e => this.eventManager.isEqual(e, event)) === undefined
+ const eventsToRemove: CalendarEvent[] = origCalendar.events.filter(
+ event => calendar.events.find(e => this._eventManager.isEqual(e, event)) === undefined
);
// note, both of the loops below could be removed if the add and delete endpoints
// allowed multiple job_ids
- //add all new jobs
+ // add all new jobs
if (jobsToAdd.length) {
- await this.callWithRequest('ml.addJobToCalendar', {
+ await this._client('ml.addJobToCalendar', {
calendarId,
jobId: jobsToAdd.join(','),
});
}
- //remove all removed jobs
+ // remove all removed jobs
if (jobsToRemove.length) {
- await this.callWithRequest('ml.removeJobFromCalendar', {
+ await this._client('ml.removeJobFromCalendar', {
calendarId,
jobId: jobsToRemove.join(','),
});
@@ -121,13 +147,13 @@ export class CalendarManager {
// add all new events
if (eventsToAdd.length !== 0) {
- await this.eventManager.addEvents(calendarId, eventsToAdd);
+ await this._eventManager.addEvents(calendarId, eventsToAdd);
}
// remove all removed events
await Promise.all(
eventsToRemove.map(async event => {
- await this.eventManager.deleteEvent(calendarId, event.event_id);
+ await this._eventManager.deleteEvent(calendarId, event.event_id);
})
);
} catch (error) {
@@ -138,7 +164,7 @@ export class CalendarManager {
return await this.getCalendar(calendarId);
}
- async deleteCalendar(calendarId) {
- return this.callWithRequest('ml.deleteCalendar', { calendarId });
+ async deleteCalendar(calendarId: string) {
+ return this._client('ml.deleteCalendar', { calendarId });
}
}
diff --git a/x-pack/legacy/plugins/ml/server/models/calendar/event_manager.js b/x-pack/legacy/plugins/ml/server/models/calendar/event_manager.ts
similarity index 51%
rename from x-pack/legacy/plugins/ml/server/models/calendar/event_manager.js
rename to x-pack/legacy/plugins/ml/server/models/calendar/event_manager.ts
index 8bdb5dcf4a3e3a..19f2eda4661796 100644
--- a/x-pack/legacy/plugins/ml/server/models/calendar/event_manager.js
+++ b/x-pack/legacy/plugins/ml/server/models/calendar/event_manager.ts
@@ -6,14 +6,24 @@
import Boom from 'boom';
+export interface CalendarEvent {
+ calendar_id?: string;
+ event_id?: string;
+ description: string;
+ start_time: number;
+ end_time: number;
+}
+
export class EventManager {
- constructor(callWithRequest) {
- this.callWithRequest = callWithRequest;
+ private _client: any;
+ constructor(client: any) {
+ this._client = client;
}
- async getCalendarEvents(calendarId) {
+ async getCalendarEvents(calendarId: string) {
try {
- const resp = await this.callWithRequest('ml.events', { calendarId });
+ const resp = await this._client('ml.events', { calendarId });
+
return resp.events;
} catch (error) {
throw Boom.badRequest(error);
@@ -21,31 +31,38 @@ export class EventManager {
}
// jobId is optional
- async getAllEvents(jobId) {
+ async getAllEvents(jobId?: string) {
const calendarId = '_all';
try {
- const resp = await this.callWithRequest('ml.events', { calendarId, jobId });
+ const resp = await this._client('ml.events', {
+ calendarId,
+ jobId,
+ });
+
return resp.events;
} catch (error) {
throw Boom.badRequest(error);
}
}
- async addEvents(calendarId, events) {
+ async addEvents(calendarId: string, events: CalendarEvent[]) {
const body = { events };
try {
- return await this.callWithRequest('ml.addEvent', { calendarId, body });
+ return await this._client('ml.addEvent', {
+ calendarId,
+ body,
+ });
} catch (error) {
throw Boom.badRequest(error);
}
}
- async deleteEvent(calendarId, eventId) {
- return this.callWithRequest('ml.deleteEvent', { calendarId, eventId });
+ async deleteEvent(calendarId: string, eventId: string) {
+ return this._client('ml.deleteEvent', { calendarId, eventId });
}
- isEqual(ev1, ev2) {
+ isEqual(ev1: CalendarEvent, ev2: CalendarEvent) {
return (
ev1.event_id === ev2.event_id &&
ev1.description === ev2.description &&
diff --git a/x-pack/legacy/plugins/ml/server/models/calendar/index.js b/x-pack/legacy/plugins/ml/server/models/calendar/index.ts
similarity index 75%
rename from x-pack/legacy/plugins/ml/server/models/calendar/index.js
rename to x-pack/legacy/plugins/ml/server/models/calendar/index.ts
index 11f99bc8fd9228..2364c3ac738112 100644
--- a/x-pack/legacy/plugins/ml/server/models/calendar/index.js
+++ b/x-pack/legacy/plugins/ml/server/models/calendar/index.ts
@@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
-export { CalendarManager } from './calendar_manager';
+export { CalendarManager, Calendar, FormCalendar } from './calendar_manager';
diff --git a/x-pack/legacy/plugins/ml/server/models/job_service/groups.js b/x-pack/legacy/plugins/ml/server/models/job_service/groups.js
index 91f82f04a9a0c4..58237b2a8a7301 100644
--- a/x-pack/legacy/plugins/ml/server/models/job_service/groups.js
+++ b/x-pack/legacy/plugins/ml/server/models/job_service/groups.js
@@ -7,7 +7,7 @@
import { CalendarManager } from '../calendar';
export function groupsProvider(callWithRequest) {
- const calMngr = new CalendarManager(callWithRequest);
+ const calMngr = new CalendarManager(true, callWithRequest);
async function getAllGroups() {
const groups = {};
diff --git a/x-pack/legacy/plugins/ml/server/models/job_service/jobs.js b/x-pack/legacy/plugins/ml/server/models/job_service/jobs.js
index b4b476c1f926ea..e60593c9f0ed59 100644
--- a/x-pack/legacy/plugins/ml/server/models/job_service/jobs.js
+++ b/x-pack/legacy/plugins/ml/server/models/job_service/jobs.js
@@ -22,7 +22,7 @@ export function jobsProvider(callWithRequest) {
const { forceDeleteDatafeed, getDatafeedIdsByJobId } = datafeedsProvider(callWithRequest);
const { getAuditMessagesSummary } = jobAuditMessagesProvider(callWithRequest);
const { getLatestBucketTimestampByJob } = resultsServiceProvider(callWithRequest);
- const calMngr = new CalendarManager(callWithRequest);
+ const calMngr = new CalendarManager(true, callWithRequest);
async function forceDeleteJob(jobId) {
return callWithRequest('ml.deleteJob', { jobId, force: true });
diff --git a/x-pack/legacy/plugins/ml/server/new_platform/calendars_schema.ts b/x-pack/legacy/plugins/ml/server/new_platform/calendars_schema.ts
new file mode 100644
index 00000000000000..f5e59d983a9aa0
--- /dev/null
+++ b/x-pack/legacy/plugins/ml/server/new_platform/calendars_schema.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { schema } from '@kbn/config-schema';
+
+export const calendarSchema = {
+ calendar_id: schema.maybe(schema.string()),
+ calendarId: schema.string(),
+ job_ids: schema.arrayOf(schema.maybe(schema.string())),
+ description: schema.maybe(schema.string()),
+ events: schema.arrayOf(
+ schema.maybe(
+ schema.object({
+ event_id: schema.maybe(schema.string()),
+ calendar_id: schema.maybe(schema.string()),
+ description: schema.maybe(schema.string()),
+ start_time: schema.any(),
+ end_time: schema.any(),
+ })
+ )
+ ),
+};
diff --git a/x-pack/legacy/plugins/ml/server/new_platform/plugin.ts b/x-pack/legacy/plugins/ml/server/new_platform/plugin.ts
index 681b2ff20c8aa5..2b9219b2226f57 100644
--- a/x-pack/legacy/plugins/ml/server/new_platform/plugin.ts
+++ b/x-pack/legacy/plugins/ml/server/new_platform/plugin.ts
@@ -41,13 +41,11 @@ import { makeMlUsageCollector } from '../lib/ml_telemetry';
import { notificationRoutes } from '../routes/notification_settings';
// @ts-ignore: could not find declaration file for module
import { systemRoutes } from '../routes/system';
-// @ts-ignore: could not find declaration file for module
import { dataFrameAnalyticsRoutes } from '../routes/data_frame_analytics';
// @ts-ignore: could not find declaration file for module
import { dataRecognizer } from '../routes/modules';
// @ts-ignore: could not find declaration file for module
import { dataVisualizerRoutes } from '../routes/data_visualizer';
-// @ts-ignore: could not find declaration file for module
import { calendars } from '../routes/calendars';
// @ts-ignore: could not find declaration file for module
import { fieldsService } from '../routes/fields_service';
diff --git a/x-pack/legacy/plugins/ml/server/routes/calendars.js b/x-pack/legacy/plugins/ml/server/routes/calendars.js
deleted file mode 100644
index 7a0f341ef96665..00000000000000
--- a/x-pack/legacy/plugins/ml/server/routes/calendars.js
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { callWithRequestFactory } from '../client/call_with_request_factory';
-import { wrapError } from '../client/errors';
-import { CalendarManager } from '../models/calendar';
-
-function getAllCalendars(callWithRequest) {
- const cal = new CalendarManager(callWithRequest);
- return cal.getAllCalendars();
-}
-
-function getCalendar(callWithRequest, calendarId) {
- const cal = new CalendarManager(callWithRequest);
- return cal.getCalendar(calendarId);
-}
-
-function newCalendar(callWithRequest, calendar) {
- const cal = new CalendarManager(callWithRequest);
- return cal.newCalendar(calendar);
-}
-
-function updateCalendar(callWithRequest, calendarId, calendar) {
- const cal = new CalendarManager(callWithRequest);
- return cal.updateCalendar(calendarId, calendar);
-}
-
-function deleteCalendar(callWithRequest, calendarId) {
- const cal = new CalendarManager(callWithRequest);
- return cal.deleteCalendar(calendarId);
-}
-
-function getCalendarsByIds(callWithRequest, calendarIds) {
- const cal = new CalendarManager(callWithRequest);
- return cal.getCalendarsByIds(calendarIds);
-}
-
-export function calendars({ commonRouteConfig, elasticsearchPlugin, route }) {
- route({
- method: 'GET',
- path: '/api/ml/calendars',
- handler(request) {
- const callWithRequest = callWithRequestFactory(elasticsearchPlugin, request);
- return getAllCalendars(callWithRequest).catch(resp => wrapError(resp));
- },
- config: {
- ...commonRouteConfig,
- },
- });
-
- route({
- method: 'GET',
- path: '/api/ml/calendars/{calendarIds}',
- handler(request) {
- const callWithRequest = callWithRequestFactory(elasticsearchPlugin, request);
- const calendarIds = request.params.calendarIds.split(',');
- if (calendarIds.length === 1) {
- return getCalendar(callWithRequest, calendarIds[0]).catch(resp => wrapError(resp));
- } else {
- return getCalendarsByIds(callWithRequest, calendarIds).catch(resp => wrapError(resp));
- }
- },
- config: {
- ...commonRouteConfig,
- },
- });
-
- route({
- method: 'PUT',
- path: '/api/ml/calendars',
- handler(request) {
- const callWithRequest = callWithRequestFactory(elasticsearchPlugin, request);
- const body = request.payload;
- return newCalendar(callWithRequest, body).catch(resp => wrapError(resp));
- },
- config: {
- ...commonRouteConfig,
- },
- });
-
- route({
- method: 'PUT',
- path: '/api/ml/calendars/{calendarId}',
- handler(request) {
- const callWithRequest = callWithRequestFactory(elasticsearchPlugin, request);
- const calendarId = request.params.calendarId;
- const body = request.payload;
- return updateCalendar(callWithRequest, calendarId, body).catch(resp => wrapError(resp));
- },
- config: {
- ...commonRouteConfig,
- },
- });
-
- route({
- method: 'DELETE',
- path: '/api/ml/calendars/{calendarId}',
- handler(request) {
- const callWithRequest = callWithRequestFactory(elasticsearchPlugin, request);
- const calendarId = request.params.calendarId;
- return deleteCalendar(callWithRequest, calendarId).catch(resp => wrapError(resp));
- },
- config: {
- ...commonRouteConfig,
- },
- });
-}
diff --git a/x-pack/legacy/plugins/ml/server/routes/calendars.ts b/x-pack/legacy/plugins/ml/server/routes/calendars.ts
new file mode 100644
index 00000000000000..19d614a4e6a228
--- /dev/null
+++ b/x-pack/legacy/plugins/ml/server/routes/calendars.ts
@@ -0,0 +1,155 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { RequestHandlerContext } from 'src/core/server';
+import { schema } from '@kbn/config-schema';
+import { licensePreRoutingFactory } from '../new_platform/licence_check_pre_routing_factory';
+import { wrapError } from '../client/error_wrapper';
+import { RouteInitialization } from '../new_platform/plugin';
+import { calendarSchema } from '../new_platform/calendars_schema';
+import { CalendarManager, Calendar, FormCalendar } from '../models/calendar';
+
+function getAllCalendars(context: RequestHandlerContext) {
+ const cal = new CalendarManager(false, context);
+ return cal.getAllCalendars();
+}
+
+function getCalendar(context: RequestHandlerContext, calendarId: string) {
+ const cal = new CalendarManager(false, context);
+ return cal.getCalendar(calendarId);
+}
+
+function newCalendar(context: RequestHandlerContext, calendar: FormCalendar) {
+ const cal = new CalendarManager(false, context);
+ return cal.newCalendar(calendar);
+}
+
+function updateCalendar(context: RequestHandlerContext, calendarId: string, calendar: Calendar) {
+ const cal = new CalendarManager(false, context);
+ return cal.updateCalendar(calendarId, calendar);
+}
+
+function deleteCalendar(context: RequestHandlerContext, calendarId: string) {
+ const cal = new CalendarManager(false, context);
+ return cal.deleteCalendar(calendarId);
+}
+
+function getCalendarsByIds(context: RequestHandlerContext, calendarIds: string) {
+ const cal = new CalendarManager(false, context);
+ return cal.getCalendarsByIds(calendarIds);
+}
+
+export function calendars({ xpackMainPlugin, router }: RouteInitialization) {
+ router.get(
+ {
+ path: '/api/ml/calendars',
+ validate: false,
+ },
+ licensePreRoutingFactory(xpackMainPlugin, async (context, request, response) => {
+ try {
+ const resp = await getAllCalendars(context);
+
+ return response.ok({
+ body: resp,
+ });
+ } catch (e) {
+ return response.customError(wrapError(e));
+ }
+ })
+ );
+
+ router.get(
+ {
+ path: '/api/ml/calendars/{calendarIds}',
+ validate: {
+ params: schema.object({ calendarIds: schema.string() }),
+ },
+ },
+ licensePreRoutingFactory(xpackMainPlugin, async (context, request, response) => {
+ let returnValue;
+ try {
+ const calendarIds = request.params.calendarIds.split(',');
+
+ if (calendarIds.length === 1) {
+ returnValue = await getCalendar(context, calendarIds[0]);
+ } else {
+ returnValue = await getCalendarsByIds(context, calendarIds);
+ }
+
+ return response.ok({
+ body: returnValue,
+ });
+ } catch (e) {
+ return response.customError(wrapError(e));
+ }
+ })
+ );
+
+ router.put(
+ {
+ path: '/api/ml/calendars',
+ validate: {
+ body: schema.object({ ...calendarSchema }),
+ },
+ },
+ licensePreRoutingFactory(xpackMainPlugin, async (context, request, response) => {
+ try {
+ const body = request.body;
+ const resp = await newCalendar(context, body);
+
+ return response.ok({
+ body: resp,
+ });
+ } catch (e) {
+ return response.customError(wrapError(e));
+ }
+ })
+ );
+
+ router.put(
+ {
+ path: '/api/ml/calendars/{calendarId}',
+ validate: {
+ params: schema.object({ calendarId: schema.string() }),
+ body: schema.object({ ...calendarSchema }),
+ },
+ },
+ licensePreRoutingFactory(xpackMainPlugin, async (context, request, response) => {
+ try {
+ const { calendarId } = request.params;
+ const body = request.body;
+ const resp = await updateCalendar(context, calendarId, body);
+
+ return response.ok({
+ body: resp,
+ });
+ } catch (e) {
+ return response.customError(wrapError(e));
+ }
+ })
+ );
+
+ router.delete(
+ {
+ path: '/api/ml/calendars/{calendarId}',
+ validate: {
+ params: schema.object({ calendarId: schema.string() }),
+ },
+ },
+ licensePreRoutingFactory(xpackMainPlugin, async (context, request, response) => {
+ try {
+ const { calendarId } = request.params;
+ const resp = await deleteCalendar(context, calendarId);
+
+ return response.ok({
+ body: resp,
+ });
+ } catch (e) {
+ return response.customError(wrapError(e));
+ }
+ })
+ );
+}
From 371abf6fd22a0d1fcd008ad56522fb97b0b73ae8 Mon Sep 17 00:00:00 2001
From: Maja Grubic
Date: Thu, 30 Jan 2020 14:01:01 +0000
Subject: [PATCH 11/69] [Filter Bar] Remove flickering when opening filter bar
popover (#56222)
Co-authored-by: Elastic Machine
---
src/plugins/data/public/ui/filter_bar/filter_bar.tsx | 1 +
src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/plugins/data/public/ui/filter_bar/filter_bar.tsx b/src/plugins/data/public/ui/filter_bar/filter_bar.tsx
index 2f1b1f8588eb92..2aaceddd68f0ce 100644
--- a/src/plugins/data/public/ui/filter_bar/filter_bar.tsx
+++ b/src/plugins/data/public/ui/filter_bar/filter_bar.tsx
@@ -96,6 +96,7 @@ function FilterBarUI(props: Props) {
withTitle
panelPaddingSize="none"
ownFocus={true}
+ initialFocus=".filterEditor__hiddenItem"
>
diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx
index b058d231b83065..b83c3a8e905dcb 100644
--- a/src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx
+++ b/src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx
@@ -95,6 +95,7 @@ class FilterEditorUI extends Component {
defaultMessage="Edit filter"
/>
+
{this.state.isCustomEditorOpen ? (
From 2d3a656b7570ce47003c81ca3efd7bbf7bd23690 Mon Sep 17 00:00:00 2001
From: Jean-Louis Leysens
Date: Thu, 30 Jan 2020 15:57:10 +0100
Subject: [PATCH 12/69] Sort returned list of objects (#56356)
---
.../application/hooks/use_data_init/use_data_init.ts | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/plugins/console/public/application/hooks/use_data_init/use_data_init.ts b/src/plugins/console/public/application/hooks/use_data_init/use_data_init.ts
index 2212827c1f5980..2722c7a1665d3d 100644
--- a/src/plugins/console/public/application/hooks/use_data_init/use_data_init.ts
+++ b/src/plugins/console/public/application/hooks/use_data_init/use_data_init.ts
@@ -51,8 +51,12 @@ export const useDataInit = () => {
});
dispatch({ type: 'setCurrentTextObject', payload: newObject });
} else {
- // For now, we always take the first text object returned.
- dispatch({ type: 'setCurrentTextObject', payload: results[0] });
+ dispatch({
+ type: 'setCurrentTextObject',
+ // For backwards compatibility, we sort here according to date created to
+ // always take the first item created.
+ payload: results.sort((a, b) => a.createdAt - b.createdAt)[0],
+ });
}
} catch (e) {
setError(e);
From 6bc9cde843dd6099c3881c87ddcdc520d7393dc2 Mon Sep 17 00:00:00 2001
From: Jean-Louis Leysens
Date: Thu, 30 Jan 2020 16:00:42 +0100
Subject: [PATCH 13/69] Fix off by one issue for getting endpoint for opening
docs and tracking (#56364)
Fix security docs
---
.../public/lib/autocomplete/get_endpoint_from_position.ts | 5 ++++-
.../server/spec/generated/security.put_privileges.json | 2 +-
.../server/spec/overrides/security.delete_privileges.json | 2 ++
.../server/spec/overrides/security.put_privileges.json | 2 ++
4 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/plugins/console/public/lib/autocomplete/get_endpoint_from_position.ts b/src/plugins/console/public/lib/autocomplete/get_endpoint_from_position.ts
index cb037e29e33f64..8cac8d1208cee9 100644
--- a/src/plugins/console/public/lib/autocomplete/get_endpoint_from_position.ts
+++ b/src/plugins/console/public/lib/autocomplete/get_endpoint_from_position.ts
@@ -30,7 +30,10 @@ export function getEndpointFromPosition(editor: CoreEditor, pos: Position, parse
const context = {
...getCurrentMethodAndTokenPaths(
editor,
- { column: lineValue.length, lineNumber: pos.lineNumber },
+ {
+ column: lineValue.length + 1 /* Go to the very end of the line */,
+ lineNumber: pos.lineNumber,
+ },
parser,
true
),
diff --git a/x-pack/plugins/console_extensions/server/spec/generated/security.put_privileges.json b/x-pack/plugins/console_extensions/server/spec/generated/security.put_privileges.json
index 7ecffc780c0662..a42d5eb6c953ee 100644
--- a/x-pack/plugins/console_extensions/server/spec/generated/security.put_privileges.json
+++ b/x-pack/plugins/console_extensions/server/spec/generated/security.put_privileges.json
@@ -12,7 +12,7 @@
"POST"
],
"patterns": [
- "_security/privilege/"
+ "_security/privilege"
],
"documentation": "TODO"
}
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.delete_privileges.json b/x-pack/plugins/console_extensions/server/spec/overrides/security.delete_privileges.json
index 35fb78c532c12b..5486098ff7bd8e 100644
--- a/x-pack/plugins/console_extensions/server/spec/overrides/security.delete_privileges.json
+++ b/x-pack/plugins/console_extensions/server/spec/overrides/security.delete_privileges.json
@@ -1,3 +1,5 @@
{
+ "security.delete_privileges": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html"
+ }
}
diff --git a/x-pack/plugins/console_extensions/server/spec/overrides/security.put_privileges.json b/x-pack/plugins/console_extensions/server/spec/overrides/security.put_privileges.json
index ae37d9a889543d..9ebb1046047a73 100644
--- a/x-pack/plugins/console_extensions/server/spec/overrides/security.put_privileges.json
+++ b/x-pack/plugins/console_extensions/server/spec/overrides/security.put_privileges.json
@@ -1,3 +1,5 @@
{
+ "security.put_privileges": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html"
+ }
}
From ed9cf94920bd1ed0e3d368c711a8dd3089f40b34 Mon Sep 17 00:00:00 2001
From: Jean-Louis Leysens
Date: Thu, 30 Jan 2020 16:31:27 +0100
Subject: [PATCH 14/69] [Watcher] Follow up on flaky functional test (#56384)
* Skip flaky watcher FF test
* Give a bit more time for machines on CI
* Update watcher_test.js
* Revert "Update watcher_test.js"
This reverts commit 8a0289f9f15d92bdfd70ec2eb4dbc2b4c9dcf903.
* Revert "Give a bit more time for machines on CI"
This reverts commit d11228d6187121cf1cca2415a5c6f77de887f7bc.
---
x-pack/test/functional/apps/watcher/watcher_test.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/x-pack/test/functional/apps/watcher/watcher_test.js b/x-pack/test/functional/apps/watcher/watcher_test.js
index a3b955f8fccee3..a2da0aad2d3c56 100644
--- a/x-pack/test/functional/apps/watcher/watcher_test.js
+++ b/x-pack/test/functional/apps/watcher/watcher_test.js
@@ -18,7 +18,10 @@ export default function({ getService, getPageObjects }) {
const esSupertest = getService('esSupertest');
const PageObjects = getPageObjects(['security', 'common', 'header', 'settings', 'watcher']);
- describe('watcher_test', function() {
+ // Still flaky test :c
+ // https://github.com/elastic/kibana/pull/56361
+ // https://github.com/elastic/kibana/pull/56304
+ describe.skip('watcher_test', function() {
before('initialize tests', async () => {
// There may be system watches if monitoring was previously enabled
// These cannot be deleted via the UI, so we need to delete via the API
From c504c40ba911950be770c164fe82f669f03a9633 Mon Sep 17 00:00:00 2001
From: Joe Reuter
Date: Thu, 30 Jan 2020 16:42:03 +0100
Subject: [PATCH 15/69] exclude tutorial resources from code ownership (#55987)
Co-authored-by: Elastic Machine
---
.github/CODEOWNERS | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 37ca1ff7bbdec6..2e2b20a46baede 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -12,7 +12,6 @@
/src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/visualize/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
-/src/legacy/core_plugins/kibana/public/home/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
/src/legacy/core_plugins/metrics/ @elastic/kibana-app
/src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
@@ -20,6 +19,10 @@
/src/plugins/home/public @elastic/kibana-app
/src/plugins/home/server/*.ts @elastic/kibana-app
/src/plugins/home/server/services/ @elastic/kibana-app
+# Exclude tutorial resources folder for now because they are not owned by Kibana app and most will move out soon
+/src/legacy/core_plugins/kibana/public/home/*.ts @elastic/kibana-app
+/src/legacy/core_plugins/kibana/public/home/*.scss @elastic/kibana-app
+/src/legacy/core_plugins/kibana/public/home/np_ready/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/timelion/ @elastic/kibana-app
/src/plugins/dev_tools/ @elastic/kibana-app
From 74b9ed6414d8801d4ac3cd9b62715f9f7c742ec8 Mon Sep 17 00:00:00 2001
From: Joe Reuter
Date: Thu, 30 Jan 2020 16:42:56 +0100
Subject: [PATCH 16/69] Move tsvb server to new platform (#55310)
---
.i18nrc.json | 2 +-
.../core_plugins/vis_type_timeseries/index.ts | 6 --
.../public/components/aggs/filter_ratio.js | 2 +-
.../public/components/aggs/metric_select.js | 8 +-
.../public/components/aggs/moving_average.js | 2 +-
.../public/components/aggs/std_agg.js | 2 +-
.../public/components/aggs/top_hit.js | 2 +-
.../public/components/index_pattern.js | 11 ++-
.../components/lib/convert_series_to_vars.js | 2 +-
.../public/components/lib/get_interval.js | 2 +-
.../components/lib/series_change_handler.js | 2 +-
.../public/components/splits/terms.js | 2 +-
.../public/components/vis_editor.js | 2 +-
.../components/vis_editor_visualization.js | 2 +-
.../public/components/vis_picker.js | 2 +-
.../public/components/vis_types/gauge/vis.js | 2 +-
.../components/vis_types/markdown/vis.js | 2 +-
.../public/components/vis_types/metric/vis.js | 4 +-
.../components/vis_types/table/is_sortable.js | 2 +-
.../public/components/vis_types/table/vis.js | 4 +-
.../components/vis_types/timeseries/series.js | 2 +-
.../components/vis_types/timeseries/vis.js | 2 +-
.../public/components/vis_types/top_n/vis.js | 4 +-
.../public/components/vis_with_splits.js | 2 +-
.../public/lib/check_ui_restrictions.js | 5 +-
.../public/lib/fetch_fields.js | 2 +-
.../{common => public/lib}/set_is_reversed.js | 6 +-
.../public/lib/validate_interval.js | 2 +-
.../public/metrics_type.ts | 2 +-
.../public/visualizations/views/gauge.js | 4 +-
.../public/visualizations/views/metric.js | 2 +-
.../public/visualizations/views/top_n.js | 2 +-
.../vis_type_timeseries/server/init.ts | 44 ---------
.../server/lib/get_fields.js | 37 --------
.../server/lib/get_index_pattern_service.js | 30 -------
.../server/lib/search_strategies/index.js | 20 -----
.../strategies/abstract_search_strategy.js | 42 ---------
.../__snapshots__/model_options.test.js.snap | 0
.../vis_type_timeseries/common/agg_lookup.js | 0
.../common/agg_lookup.test.js | 0
.../vis_type_timeseries/common/basic_aggs.js | 0
.../common/calculate_label.js | 0
.../common/calculate_label.test.js | 0
.../common/extract_index_patterns.js | 0
.../common/extract_index_patterns.test.js | 0
.../vis_type_timeseries/common/field_types.js | 0
.../common/get_last_value.js | 0
.../common/get_last_value.test.js | 0
.../common/interval_regexp.js | 0
.../common/interval_regexp.test.js | 0
.../common/metric_types.js | 0
.../common/model_options.js | 0
.../common/model_options.test.js | 0
.../vis_type_timeseries/common/panel_types.js | 0
.../common/timerange_data_modes.js | 0
.../common/to_percentile_number.js | 0
.../common/ui_restrictions.js | 0
.../vis_type_timeseries/server/index.ts | 7 ++
.../server/lib/get_fields.ts | 89 +++++++++++++++++++
.../server/lib/get_vis_data.ts | 16 ++--
.../default_search_capabilities.js | 0
.../default_search_capabilities.test.js | 0
.../server/lib/search_strategies}/index.ts | 3 +-
.../search_requests}/abstract_request.js | 0
.../search_requests}/abstract_request.test.js | 0
.../search_requests}/multi_search_request.js | 0
.../multi_search_request.test.js | 0
.../search_requests}/search_request.js | 0
.../search_requests}/search_request.test.js | 0
.../search_requests}/single_search_request.js | 0
.../single_search_request.test.js | 0
.../search_strategies_registry.test.ts} | 52 ++++-------
.../search_strategy_registry.ts} | 40 ++++-----
.../abstract_search_strategy.test.js | 0
.../strategies/abstract_search_strategy.ts | 87 ++++++++++++++++++
.../strategies/default_search_strategy.js | 2 +-
.../default_search_strategy.test.js | 0
.../annotations}/build_request_body.js | 0
.../annotations}/get_request_params.js | 0
.../vis_data/build_processor_function.test.ts | 0
.../lib/vis_data/build_processor_function.ts | 0
.../server/lib/vis_data/get_annotations.js | 4 +-
.../vis_data/get_interval_and_timefield.js | 0
.../get_interval_and_timefield.test.js | 0
.../server/lib/vis_data/get_panel_data.d.ts | 0
.../server/lib/vis_data/get_panel_data.js | 0
.../server/lib/vis_data/get_series_data.js | 9 +-
.../server/lib/vis_data/get_table_data.js | 10 +--
.../lib/vis_data/handle_error_response.js | 0
.../bucket_transform.test.js.snap | 0
.../lib/vis_data/helpers/bucket_transform.js | 0
.../vis_data/helpers/bucket_transform.test.js | 0
.../lib/vis_data/helpers/calculate_auto.js | 0
.../server/lib/vis_data/helpers/format_key.js | 0
.../lib/vis_data/helpers/get_active_series.js | 0
.../lib/vis_data/helpers/get_agg_value.js | 0
.../vis_data/helpers/get_agg_value.test.js | 0
.../lib/vis_data/helpers/get_bucket_size.js | 2 +-
.../vis_data/helpers/get_bucket_size.test.js | 0
.../lib/vis_data/helpers/get_buckets_path.js | 0
.../vis_data/helpers/get_buckets_path.test.js | 0
.../helpers/get_default_decoration.js | 0
.../helpers/get_default_decoration.test.js | 0
.../helpers/get_es_query_uisettings.js | 0
.../vis_data/helpers/get_es_shard_timeout.js | 0
.../helpers/get_es_shard_timeout.test.js | 0
.../lib/vis_data/helpers/get_index_pattern.js | 0
.../lib/vis_data/helpers/get_last_metric.js | 0
.../vis_data/helpers/get_last_metric.test.js | 0
.../vis_data/helpers/get_sibling_agg_value.js | 0
.../helpers/get_sibling_agg_value.test.js | 0
.../lib/vis_data/helpers/get_split_colors.js | 0
.../server/lib/vis_data/helpers/get_splits.js | 0
.../lib/vis_data/helpers/get_splits.test.js | 0
.../lib/vis_data/helpers/get_timerange.js | 0
.../vis_data/helpers/get_timerange.test.js | 0
.../vis_data/helpers/get_timerange_mode.js | 0
.../server/lib/vis_data/helpers/index.js | 0
.../server/lib/vis_data/helpers/map_bucket.js | 0
.../lib/vis_data/helpers/map_bucket.test.js | 0
.../lib/vis_data/helpers/moving_fn_scripts.js | 0
.../helpers/moving_fn_scripts.test.js | 0
.../lib/vis_data/helpers/parse_interval.js | 0
.../lib/vis_data/helpers/parse_settings.js | 0
.../vis_data/helpers/parse_settings.test.js | 0
.../server/lib/vis_data/helpers/timestamp.js | 0
.../lib/vis_data/helpers/timestamp.test.js | 0
.../lib/vis_data/helpers/unit_to_seconds.js | 0
.../vis_data/helpers/unit_to_seconds.test.js | 0
.../server/lib/vis_data/offset_time.js | 0
.../server/lib/vis_data/offset_time.test.js | 0
.../annotations/date_histogram.js | 2 +-
.../request_processors/annotations/index.js | 0
.../request_processors/annotations/query.js | 2 +-
.../annotations/top_hits.js | 0
.../series/date_histogram.js | 2 +-
.../series/date_histogram.test.js | 0
.../series/filter_ratios.js | 0
.../series/filter_ratios.test.js | 0
.../request_processors/series/index.js | 0
.../series/metric_buckets.js | 0
.../series/metric_buckets.test.js | 0
.../series/normalize_query.js | 0
.../series/normalize_query.test.js | 0
.../request_processors/series/query.js | 2 +-
.../request_processors/series/query.test.js | 0
.../series/sibling_buckets.js | 0
.../series/sibling_buckets.test.js | 0
.../series/split_by_everything.js | 0
.../series/split_by_everything.test.js | 0
.../series/split_by_filter.js | 2 +-
.../series/split_by_filter.test.js | 0
.../series/split_by_filters.js | 2 +-
.../series/split_by_filters.test.js | 0
.../series/split_by_terms.js | 0
.../series/split_by_terms.test.js | 0
.../table/calculate_agg_root.js | 0
.../table/date_histogram.js | 2 +-
.../request_processors/table/filter_ratios.js | 0
.../request_processors/table/index.js | 0
.../table/metric_buckets.js | 0
.../table/normalize_query.js | 0
.../table/normalize_query.test.js | 0
.../request_processors/table/pivot.js | 0
.../request_processors/table/query.js | 2 +-
.../table/sibling_buckets.js | 0
.../table/split_by_everything.js | 2 +-
.../table/split_by_terms.js | 2 +-
.../annotations/buckets.js | 0
.../response_processors/annotations/filter.js | 0
.../annotations/filter.test.js | 0
.../response_processors/annotations/index.js | 0
.../response_processors/series/_series_agg.js | 0
.../series/_series_agg.test.js | 0
.../series/drop_last_bucket.js | 0
.../response_processors/series/index.js | 0
.../response_processors/series/math.js | 0
.../response_processors/series/percentile.js | 0
.../series/percentile.test.js | 0
.../series/percentile_rank.js | 0
.../response_processors/series/series_agg.js | 0
.../series/series_agg.test.js | 0
.../series/std_deviation_bands.js | 0
.../series/std_deviation_bands.test.js | 0
.../series/std_deviation_sibling.js | 0
.../series/std_deviation_sibling.test.js | 0
.../response_processors/series/std_metric.js | 0
.../series/std_metric.test.js | 0
.../response_processors/series/std_sibling.js | 0
.../series/std_sibling.test.js | 0
.../response_processors/series/time_shift.js | 0
.../series/time_shift.test.js | 0
.../response_processors/table/_series_agg.js | 0
.../table/drop_last_bucket.js | 0
.../response_processors/table/index.js | 0
.../response_processors/table/math.js | 0
.../response_processors/table/percentile.js | 0
.../table/percentile_rank.js | 0
.../response_processors/table/series_agg.js | 0
.../response_processors/table/std_metric.js | 0
.../response_processors/table/std_sibling.js | 0
.../series/build_request_body.test.ts | 0
.../lib/vis_data/series/build_request_body.ts | 2 +-
.../lib/vis_data/series/get_request_params.js | 0
.../vis_data/series/handle_response_body.js | 0
.../lib/vis_data/table/build_request_body.js | 0
.../lib/vis_data/table/process_bucket.js | 0
.../vis_type_timeseries/server/plugin.ts | 60 +++++++------
.../server/routes/fields.ts} | 37 +++++---
.../server/routes/post_vis_schema.ts | 0
.../vis_type_timeseries/server/routes/vis.ts | 15 ++--
.../framework/kibana_framework_adapter.ts | 3 +-
.../metrics/kibana_metrics_adapter.ts | 7 +-
.../lib/populate_series_with_tsvb_data.ts | 8 +-
x-pack/legacy/plugins/rollup/index.js | 2 +-
.../call_with_request_factory.js | 8 +-
.../register_rollup_search_strategy.js | 18 ++--
.../register_rollup_search_strategy.test.js | 18 ++--
218 files changed, 405 insertions(+), 385 deletions(-)
rename src/legacy/core_plugins/vis_type_timeseries/{common => public/lib}/set_is_reversed.js (92%)
delete mode 100644 src/legacy/core_plugins/vis_type_timeseries/server/init.ts
delete mode 100644 src/legacy/core_plugins/vis_type_timeseries/server/lib/get_fields.js
delete mode 100644 src/legacy/core_plugins/vis_type_timeseries/server/lib/get_index_pattern_service.js
delete mode 100644 src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/index.js
delete mode 100644 src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.js
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/__snapshots__/model_options.test.js.snap (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/agg_lookup.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/agg_lookup.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/basic_aggs.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/calculate_label.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/calculate_label.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/extract_index_patterns.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/extract_index_patterns.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/field_types.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/get_last_value.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/get_last_value.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/interval_regexp.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/interval_regexp.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/metric_types.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/model_options.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/model_options.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/panel_types.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/timerange_data_modes.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/to_percentile_number.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/common/ui_restrictions.js (100%)
create mode 100644 src/plugins/vis_type_timeseries/server/lib/get_fields.ts
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/get_vis_data.ts (87%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.test.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server => plugins/vis_type_timeseries/server/lib/search_strategies}/index.ts (87%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests => plugins/vis_type_timeseries/server/lib/search_strategies/search_requests}/abstract_request.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests => plugins/vis_type_timeseries/server/lib/search_strategies/search_requests}/abstract_request.test.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests => plugins/vis_type_timeseries/server/lib/search_strategies/search_requests}/multi_search_request.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests => plugins/vis_type_timeseries/server/lib/search_strategies/search_requests}/multi_search_request.test.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests => plugins/vis_type_timeseries/server/lib/search_strategies/search_requests}/search_request.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests => plugins/vis_type_timeseries/server/lib/search_strategies/search_requests}/search_request.test.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests => plugins/vis_type_timeseries/server/lib/search_strategies/search_requests}/single_search_request.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests => plugins/vis_type_timeseries/server/lib/search_strategies/search_requests}/single_search_request.test.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_register.test.js => plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_registry.test.ts} (61%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_register.js => plugins/vis_type_timeseries/server/lib/search_strategies/search_strategy_registry.ts} (57%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.js (100%)
create mode 100644 src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.js (95%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/annorations => plugins/vis_type_timeseries/server/lib/vis_data/annotations}/build_request_body.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/annorations => plugins/vis_type_timeseries/server/lib/vis_data/annotations}/get_request_params.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/build_processor_function.test.ts (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/build_processor_function.ts (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/get_annotations.js (96%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/get_panel_data.d.ts (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/get_panel_data.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/get_series_data.js (91%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/get_table_data.js (90%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/handle_error_response.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/__snapshots__/bucket_transform.test.js.snap (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/calculate_auto.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/format_key.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_active_series.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.js (97%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_es_query_uisettings.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_index_pattern.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_split_colors.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange_mode.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/index.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/parse_interval.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/offset_time.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/offset_time.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js (94%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/index.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js (97%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js (96%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/index.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.js (96%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.js (94%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.js (94%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/calculate_agg_root.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js (96%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/filter_ratios.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/index.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/metric_buckets.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/pivot.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/query.js (96%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/sibling_buckets.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_everything.js (95%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_terms.js (95%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/buckets.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/index.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/drop_last_bucket.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/math.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.test.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/_series_agg.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/drop_last_bucket.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/index.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/math.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile_rank.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/series_agg.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_metric.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_sibling.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/series/build_request_body.test.ts (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/series/build_request_body.ts (95%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/series/get_request_params.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/table/build_request_body.js (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/lib/vis_data/table/process_bucket.js (100%)
rename src/{legacy/core_plugins/vis_type_timeseries/server/routes/fields.js => plugins/vis_type_timeseries/server/routes/fields.ts} (54%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/routes/post_vis_schema.ts (100%)
rename src/{legacy/core_plugins => plugins}/vis_type_timeseries/server/routes/vis.ts (85%)
diff --git a/.i18nrc.json b/.i18nrc.json
index 98c36b43e5d8fa..1230151212f573 100644
--- a/.i18nrc.json
+++ b/.i18nrc.json
@@ -40,7 +40,7 @@
"visTypeMetric": "src/legacy/core_plugins/vis_type_metric",
"visTypeTable": "src/legacy/core_plugins/vis_type_table",
"visTypeTagCloud": "src/legacy/core_plugins/vis_type_tagcloud",
- "visTypeTimeseries": "src/legacy/core_plugins/vis_type_timeseries",
+ "visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",
"visTypeVislib": "src/legacy/core_plugins/vis_type_vislib",
"visualizations": [
diff --git a/src/legacy/core_plugins/vis_type_timeseries/index.ts b/src/legacy/core_plugins/vis_type_timeseries/index.ts
index a502bb174bc997..3ad8ba3a31c17e 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/index.ts
+++ b/src/legacy/core_plugins/vis_type_timeseries/index.ts
@@ -21,7 +21,6 @@ import { resolve } from 'path';
import { Legacy } from 'kibana';
import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy/types';
-import { VisTypeTimeseriesSetup } from '../../../plugins/vis_type_timeseries/server';
const metricsPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) =>
new Plugin({
@@ -47,11 +46,6 @@ const metricsPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPlu
},
},
},
- init: (server: Legacy.Server) => {
- const visTypeTimeSeriesPlugin = server.newPlatform.setup.plugins
- .metrics as VisTypeTimeseriesSetup;
- visTypeTimeSeriesPlugin.__legacy.registerLegacyAPI({ server });
- },
config(Joi: any) {
return Joi.object({
enabled: Joi.boolean().default(true),
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/filter_ratio.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/filter_ratio.js
index 355c4723587d6f..5bd7f6557e8877 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/filter_ratio.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/filter_ratio.js
@@ -36,7 +36,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { KBN_FIELD_TYPES } from '../../../../../../plugins/data/public';
-import { METRIC_TYPES } from '../../../common/metric_types';
+import { METRIC_TYPES } from '../../../../../../plugins/vis_type_timeseries/common/metric_types';
export const FilterRatioAgg = props => {
const { series, fields, panel } = props;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/metric_select.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/metric_select.js
index 5e2f148ab5a6e5..18daecd6999037 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/metric_select.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/metric_select.js
@@ -23,10 +23,10 @@ import { includes } from 'lodash';
import { injectI18n } from '@kbn/i18n/react';
import { EuiComboBox } from '@elastic/eui';
import { calculateSiblings } from '../lib/calculate_siblings';
-import { calculateLabel } from '../../../common/calculate_label';
-import { basicAggs } from '../../../common/basic_aggs';
-import { toPercentileNumber } from '../../../common/to_percentile_number';
-import { METRIC_TYPES } from '../../../common/metric_types';
+import { calculateLabel } from '../../../../../../plugins/vis_type_timeseries/common/calculate_label';
+import { basicAggs } from '../../../../../../plugins/vis_type_timeseries/common/basic_aggs';
+import { toPercentileNumber } from '../../../../../../plugins/vis_type_timeseries/common/to_percentile_number';
+import { METRIC_TYPES } from '../../../../../../plugins/vis_type_timeseries/common/metric_types';
function createTypeFilter(restrict, exclude) {
return metric => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/moving_average.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/moving_average.js
index 3b9d0ab2826826..5843eab3f4707a 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/moving_average.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/moving_average.js
@@ -36,7 +36,7 @@ import {
EuiFieldNumber,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { MODEL_TYPES } from '../../../common/model_options';
+import { MODEL_TYPES } from '../../../../../../plugins/vis_type_timeseries/common/model_options';
const DEFAULTS = {
model_type: MODEL_TYPES.UNWEIGHTED,
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_agg.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_agg.js
index 67fe9403e402b9..61e5c60cbd72aa 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_agg.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_agg.js
@@ -34,7 +34,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { KBN_FIELD_TYPES } from '../../../../../../plugins/data/public';
-import { METRIC_TYPES } from '../../../common/metric_types';
+import { METRIC_TYPES } from '../../../../../../plugins/vis_type_timeseries/common/metric_types';
export function StandardAgg(props) {
const { model, panel, series, fields, uiRestrictions } = props;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/top_hit.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/top_hit.js
index fa92713046aca8..df13b943940610 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/top_hit.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/top_hit.js
@@ -36,7 +36,7 @@ import {
} from '@elastic/eui';
import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
import { KBN_FIELD_TYPES } from '../../../../../../plugins/data/public';
-import { PANEL_TYPES } from '../../../common/panel_types';
+import { PANEL_TYPES } from '../../../../../../plugins/vis_type_timeseries/common/panel_types';
const isFieldTypeEnabled = (fieldRestrictions, fieldType) =>
fieldRestrictions.length ? fieldRestrictions.includes(fieldType) : true;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/index_pattern.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/index_pattern.js
index 352747013fe29e..de8469adfb8a73 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/index_pattern.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/index_pattern.js
@@ -42,8 +42,11 @@ import {
AUTO_INTERVAL,
} from './lib/get_interval';
import { i18n } from '@kbn/i18n';
-import { TIME_RANGE_DATA_MODES, TIME_RANGE_MODE_KEY } from '../../common/timerange_data_modes';
-import { PANEL_TYPES } from '../../common/panel_types';
+import {
+ TIME_RANGE_DATA_MODES,
+ TIME_RANGE_MODE_KEY,
+} from '../../../../../plugins/vis_type_timeseries/common/timerange_data_modes';
+import { PANEL_TYPES } from '../../../../../plugins/vis_type_timeseries/common/panel_types';
import { isTimerangeModeEnabled } from '../lib/check_ui_restrictions';
import { VisDataContext } from '../contexts/vis_data_context';
@@ -138,8 +141,8 @@ export const IndexPattern = ({ fields, prefix, onChange, disabled, model: _model
{i18n.translate('visTypeTimeseries.indexPattern.timeRange.hint', {
- defaultMessage: `This setting controls the timespan used for matching documents.
- "Entire timerange" will match all the documents selected in the timepicker.
+ defaultMessage: `This setting controls the timespan used for matching documents.
+ "Entire timerange" will match all the documents selected in the timepicker.
"Last value" will match only the documents for the specified interval from the end of the timerange.`,
})}
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/convert_series_to_vars.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/convert_series_to_vars.js
index bcab9ec026d9ae..73fc8dac2b5645 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/convert_series_to_vars.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/convert_series_to_vars.js
@@ -18,7 +18,7 @@
*/
import _ from 'lodash';
-import { getLastValue } from '../../../common/get_last_value';
+import { getLastValue } from '../../../../../../plugins/vis_type_timeseries/common/get_last_value';
import { createTickFormatter } from './tick_formatter';
import moment from 'moment';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_interval.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_interval.js
index 05d00f6bede1af..a6aefe067dd62b 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_interval.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_interval.js
@@ -20,7 +20,7 @@ import moment from 'moment';
import { i18n } from '@kbn/i18n';
import { get } from 'lodash';
import { parseEsInterval } from '../../../../data/public';
-import { GTE_INTERVAL_RE } from '../../../common/interval_regexp';
+import { GTE_INTERVAL_RE } from '../../../../../../plugins/vis_type_timeseries/common/interval_regexp';
export const AUTO_INTERVAL = 'auto';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/series_change_handler.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/series_change_handler.js
index b13f89c204292c..e773782969d161 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/series_change_handler.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/series_change_handler.js
@@ -19,7 +19,7 @@
import _ from 'lodash';
import { newMetricAggFn } from './new_metric_agg_fn';
-import { isBasicAgg } from '../../../common/agg_lookup';
+import { isBasicAgg } from '../../../../../../plugins/vis_type_timeseries/common/agg_lookup';
import { handleAdd, handleChange } from './collection_actions';
export const seriesChangeHandler = (props, items) => doc => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/terms.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/terms.js
index 111da86d71ecb3..0fddc4f8c1d87d 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/terms.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/terms.js
@@ -36,7 +36,7 @@ import {
EuiFieldText,
} from '@elastic/eui';
import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
-import { FIELD_TYPES } from '../../../common/field_types';
+import { FIELD_TYPES } from '../../../../../../plugins/vis_type_timeseries/common/field_types';
import { STACKED_OPTIONS } from '../../visualizations/constants';
const DEFAULTS = { terms_direction: 'desc', terms_size: 10, terms_order_by: '_count' };
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor.js
index ae39d75c7a2d1d..3dedb67bd1d99a 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor.js
@@ -28,7 +28,7 @@ import { VisPicker } from './vis_picker';
import { PanelConfig } from './panel_config';
import { createBrushHandler } from '../lib/create_brush_handler';
import { fetchFields } from '../lib/fetch_fields';
-import { extractIndexPatterns } from '../../common/extract_index_patterns';
+import { extractIndexPatterns } from '../../../../../plugins/vis_type_timeseries/common/extract_index_patterns';
import { esKuery } from '../../../../../plugins/data/public';
import { npStart } from 'ui/new_platform';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor_visualization.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor_visualization.js
index a376905495c521..c45a4d68e8aada 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor_visualization.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor_visualization.js
@@ -28,7 +28,7 @@ import {
isGteInterval,
AUTO_INTERVAL,
} from './lib/get_interval';
-import { PANEL_TYPES } from '../../common/panel_types';
+import { PANEL_TYPES } from '../../../../../plugins/vis_type_timeseries/common/panel_types';
import { start as embeddables } from '../../../embeddable_api/public/np_ready/public/legacy';
const MIN_CHART_HEIGHT = 300;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_picker.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_picker.js
index 8d2673ea24cb2c..2c4a11f8880ffa 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_picker.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_picker.js
@@ -21,7 +21,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import { EuiTabs, EuiTab } from '@elastic/eui';
import { injectI18n } from '@kbn/i18n/react';
-import { PANEL_TYPES } from '../../common/panel_types';
+import { PANEL_TYPES } from '../../../../../plugins/vis_type_timeseries/common/panel_types';
function VisPickerItem(props) {
const { label, type, selected } = props;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/gauge/vis.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/gauge/vis.js
index 5d6bb55f33db69..7d30a1f0c8df54 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/gauge/vis.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/gauge/vis.js
@@ -23,7 +23,7 @@ import { visWithSplits } from '../../vis_with_splits';
import { createTickFormatter } from '../../lib/tick_formatter';
import _, { get, isUndefined, assign, includes } from 'lodash';
import { Gauge } from '../../../visualizations/views/gauge';
-import { getLastValue } from '../../../../common/get_last_value';
+import { getLastValue } from '../../../../../../../plugins/vis_type_timeseries/common/get_last_value';
function getColors(props) {
const { model, visData } = props;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/markdown/vis.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/markdown/vis.js
index e20f3d3fbaebc6..a8063390854504 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/markdown/vis.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/markdown/vis.js
@@ -26,7 +26,7 @@ import { Markdown } from '../../../../../kibana_react/public';
import { ErrorComponent } from '../../error';
import { replaceVars } from '../../lib/replace_vars';
import { convertSeriesToVars } from '../../lib/convert_series_to_vars';
-import { isBackgroundInverted } from '../../../../common/set_is_reversed';
+import { isBackgroundInverted } from '../../../lib/set_is_reversed';
const getMarkdownId = id => `markdown-${id}`;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/metric/vis.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/metric/vis.js
index f463a4494a189f..4a907a7b2078d0 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/metric/vis.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/metric/vis.js
@@ -23,8 +23,8 @@ import { visWithSplits } from '../../vis_with_splits';
import { createTickFormatter } from '../../lib/tick_formatter';
import _, { get, isUndefined, assign, includes, pick } from 'lodash';
import { Metric } from '../../../visualizations/views/metric';
-import { getLastValue } from '../../../../common/get_last_value';
-import { isBackgroundInverted } from '../../../../common/set_is_reversed';
+import { getLastValue } from '../../../../../../../plugins/vis_type_timeseries/common/get_last_value';
+import { isBackgroundInverted } from '../../../lib/set_is_reversed';
function getColors(props) {
const { model, visData } = props;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/is_sortable.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/is_sortable.js
index 887652a67f406d..b44c94131348d4 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/is_sortable.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/is_sortable.js
@@ -17,7 +17,7 @@
* under the License.
*/
-import { basicAggs } from '../../../../common/basic_aggs';
+import { basicAggs } from '../../../../../../../plugins/vis_type_timeseries/common/basic_aggs';
export function isSortable(metric) {
return basicAggs.includes(metric.type);
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/vis.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/vis.js
index a82d5bdb1588c7..94f4506cd01726 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/vis.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/vis.js
@@ -22,14 +22,14 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { npStart } from 'ui/new_platform';
import { createTickFormatter } from '../../lib/tick_formatter';
-import { calculateLabel } from '../../../../common/calculate_label';
+import { calculateLabel } from '../../../../../../../plugins/vis_type_timeseries/common/calculate_label';
import { isSortable } from './is_sortable';
import { EuiToolTip, EuiIcon } from '@elastic/eui';
import { replaceVars } from '../../lib/replace_vars';
import { fieldFormats } from '../../../../../../../plugins/data/public';
import { FormattedMessage } from '@kbn/i18n/react';
-import { METRIC_TYPES } from '../../../../common/metric_types';
+import { METRIC_TYPES } from '../../../../../../../plugins/vis_type_timeseries/common/metric_types';
function getColor(rules, colorKey, value) {
let color;
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/series.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/series.js
index 226aded390508c..27a84d9ba40b98 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/series.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/series.js
@@ -35,7 +35,7 @@ import {
import { Split } from '../../split';
import { createTextHandler } from '../../lib/create_text_handler';
import { FormattedMessage, injectI18n } from '@kbn/i18n/react';
-import { PANEL_TYPES } from '../../../../common/panel_types';
+import { PANEL_TYPES } from '../../../../../../../plugins/vis_type_timeseries/common/panel_types';
const TimeseriesSeriesUI = injectI18n(function(props) {
const {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/vis.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/vis.js
index d269d7c3546ec7..5243f5f92a621a 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/vis.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/vis.js
@@ -34,7 +34,7 @@ import { getAxisLabelString } from '../../lib/get_axis_label_string';
import { getInterval } from '../../lib/get_interval';
import { areFieldsDifferent } from '../../lib/charts';
import { createXaxisFormatter } from '../../lib/create_xaxis_formatter';
-import { isBackgroundDark } from '../../../../common/set_is_reversed';
+import { isBackgroundDark } from '../../../lib/set_is_reversed';
import { STACKED_OPTIONS } from '../../../visualizations/constants';
export class TimeseriesVisualization extends Component {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/top_n/vis.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/top_n/vis.js
index 7d09f33acdecce..2ebc60325a4251 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/top_n/vis.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/top_n/vis.js
@@ -19,8 +19,8 @@
import { createTickFormatter } from '../../lib/tick_formatter';
import { TopN } from '../../../visualizations/views/top_n';
-import { getLastValue } from '../../../../common/get_last_value';
-import { isBackgroundInverted } from '../../../../common/set_is_reversed';
+import { getLastValue } from '../../../../../../../plugins/vis_type_timeseries/common/get_last_value';
+import { isBackgroundInverted } from '../../../lib/set_is_reversed';
import { replaceVars } from '../../lib/replace_vars';
import PropTypes from 'prop-types';
import React from 'react';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_with_splits.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_with_splits.js
index 91d53b9c2e1dbd..e36910d9081b3c 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_with_splits.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_with_splits.js
@@ -20,7 +20,7 @@
import React from 'react';
import { getDisplayName } from './lib/get_display_name';
import { last, findIndex, first } from 'lodash';
-import { calculateLabel } from '../../common/calculate_label';
+import { calculateLabel } from '../../../../../plugins/vis_type_timeseries/common/calculate_label';
export function visWithSplits(WrappedComponent) {
function SplitVisComponent(props) {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/lib/check_ui_restrictions.js b/src/legacy/core_plugins/vis_type_timeseries/public/lib/check_ui_restrictions.js
index 1fade6ebe98495..5d18c0a2f09cd1 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/lib/check_ui_restrictions.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/lib/check_ui_restrictions.js
@@ -18,7 +18,10 @@
*/
import { get } from 'lodash';
-import { RESTRICTIONS_KEYS, DEFAULT_UI_RESTRICTION } from '../../common/ui_restrictions';
+import {
+ RESTRICTIONS_KEYS,
+ DEFAULT_UI_RESTRICTION,
+} from '../../../../../plugins/vis_type_timeseries/common/ui_restrictions';
/**
* Generic method for checking all types of the UI Restrictions
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/lib/fetch_fields.js b/src/legacy/core_plugins/vis_type_timeseries/public/lib/fetch_fields.js
index 21c12b07ff47fe..68e694f23fa7f9 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/lib/fetch_fields.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/lib/fetch_fields.js
@@ -19,7 +19,7 @@
import { kfetch } from 'ui/kfetch';
import { toastNotifications } from 'ui/notify';
import { i18n } from '@kbn/i18n';
-import { extractIndexPatterns } from '../../common/extract_index_patterns';
+import { extractIndexPatterns } from '../../../../../plugins/vis_type_timeseries/common/extract_index_patterns';
export async function fetchFields(indexPatterns = ['*']) {
const patterns = Array.isArray(indexPatterns) ? indexPatterns : [indexPatterns];
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/set_is_reversed.js b/src/legacy/core_plugins/vis_type_timeseries/public/lib/set_is_reversed.js
similarity index 92%
rename from src/legacy/core_plugins/vis_type_timeseries/common/set_is_reversed.js
rename to src/legacy/core_plugins/vis_type_timeseries/public/lib/set_is_reversed.js
index b633d004b9705c..9f66bcd1619166 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/common/set_is_reversed.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/lib/set_is_reversed.js
@@ -18,9 +18,9 @@
*/
import color from 'color';
-import chrome from '../../../ui/public/chrome';
+import { getUISettings } from '../services';
-const IS_DARK_THEME = chrome.getUiSettingsClient().get('theme:darkMode');
+const isDarkTheme = () => getUISettings().get('theme:darkMode');
/**
* Returns true if the color that is passed has low luminosity
@@ -34,7 +34,7 @@ const isColorDark = c => {
* Defaults to checking `theme:darkMode`.
*/
export const isThemeDark = currentTheme => {
- let themeIsDark = currentTheme || IS_DARK_THEME;
+ let themeIsDark = currentTheme || isDarkTheme();
// If passing a string, check the luminosity
if (typeof currentTheme === 'string') {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/lib/validate_interval.js b/src/legacy/core_plugins/vis_type_timeseries/public/lib/validate_interval.js
index 2dbcdc4749a660..2992549d38e308 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/lib/validate_interval.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/lib/validate_interval.js
@@ -17,7 +17,7 @@
* under the License.
*/
-import { GTE_INTERVAL_RE } from '../../common/interval_regexp';
+import { GTE_INTERVAL_RE } from '../../../../../plugins/vis_type_timeseries/common/interval_regexp';
import { i18n } from '@kbn/i18n';
import { parseInterval } from '../../../../../plugins/data/public';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/metrics_type.ts b/src/legacy/core_plugins/vis_type_timeseries/public/metrics_type.ts
index e7684cd21b7976..22d2b3b10e566a 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/metrics_type.ts
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/metrics_type.ts
@@ -26,7 +26,7 @@ import { metricsRequestHandler } from './request_handler';
// @ts-ignore
import { EditorController } from './editor_controller';
// @ts-ignore
-import { PANEL_TYPES } from '../common/panel_types';
+import { PANEL_TYPES } from '../../../../plugins/vis_type_timeseries/common/panel_types';
export const metricsVisDefinition = {
name: 'metrics',
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/gauge.js b/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/gauge.js
index 3be2e9daed58c6..b518665e5ece42 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/gauge.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/gauge.js
@@ -21,8 +21,8 @@ import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import classNames from 'classnames';
-import { isBackgroundInverted, isBackgroundDark } from '../../../common/set_is_reversed';
-import { getLastValue } from '../../../common/get_last_value';
+import { isBackgroundInverted, isBackgroundDark } from '../../lib/set_is_reversed';
+import { getLastValue } from '../../../../../../plugins/vis_type_timeseries/common/get_last_value';
import { getValueBy } from '../lib/get_value_by';
import { GaugeVis } from './gauge_vis';
import reactcss from 'reactcss';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/metric.js b/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/metric.js
index 004d59efca3330..5524e17d106e49 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/metric.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/metric.js
@@ -20,7 +20,7 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import _ from 'lodash';
-import { getLastValue } from '../../../common/get_last_value';
+import { getLastValue } from '../../../../../../plugins/vis_type_timeseries/common/get_last_value';
import reactcss from 'reactcss';
import { calculateCoordinates } from '../lib/calculate_coordinates';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/top_n.js b/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/top_n.js
index 5734d101a09d20..99e9cc0b1c2183 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/top_n.js
+++ b/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/top_n.js
@@ -19,7 +19,7 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
-import { getLastValue } from '../../../common/get_last_value';
+import { getLastValue } from '../../../../../../plugins/vis_type_timeseries/common/get_last_value';
import reactcss from 'reactcss';
const RENDER_MODES = {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/init.ts b/src/legacy/core_plugins/vis_type_timeseries/server/init.ts
deleted file mode 100644
index ae6eebc00fc1ba..00000000000000
--- a/src/legacy/core_plugins/vis_type_timeseries/server/init.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-// @ts-ignore
-import { fieldsRoutes } from './routes/fields';
-// @ts-ignore
-import { visDataRoutes } from './routes/vis';
-// @ts-ignore
-import { SearchStrategiesRegister } from './lib/search_strategies/search_strategies_register';
-// @ts-ignore
-import { getVisData } from './lib/get_vis_data';
-import { Framework } from '../../../../plugins/vis_type_timeseries/server';
-import { ValidationTelemetryServiceSetup } from '../../../../plugins/vis_type_timeseries/server';
-
-export const init = async (
- framework: Framework,
- __LEGACY: any,
- validationTelemetry: ValidationTelemetryServiceSetup
-) => {
- const { core } = framework;
- const router = core.http.createRouter();
-
- visDataRoutes(router, framework, validationTelemetry);
-
- // [LEGACY_TODO]
- fieldsRoutes(__LEGACY.server);
- SearchStrategiesRegister.init(__LEGACY.server);
-};
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/get_fields.js b/src/legacy/core_plugins/vis_type_timeseries/server/lib/get_fields.js
deleted file mode 100644
index 361ce132f17359..00000000000000
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/get_fields.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { SearchStrategiesRegister } from './search_strategies/search_strategies_register';
-import { uniq } from 'lodash';
-import { getIndexPatternObject } from './vis_data/helpers/get_index_pattern';
-import { isNestedField } from '../../../../../plugins/data/server';
-
-export async function getFields(req) {
- const indexPattern = req.query.index;
- const { indexPatternString } = await getIndexPatternObject(req, indexPattern);
- const { searchStrategy, capabilities } = await SearchStrategiesRegister.getViableStrategy(
- req,
- indexPatternString
- );
-
- const fields = (
- await searchStrategy.getFieldsForWildcard(req, indexPatternString, capabilities)
- ).filter(field => field.aggregatable && !isNestedField(field));
-
- return uniq(fields, field => field.name);
-}
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/get_index_pattern_service.js b/src/legacy/core_plugins/vis_type_timeseries/server/lib/get_index_pattern_service.js
deleted file mode 100644
index 54e90ab7dd9b7f..00000000000000
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/get_index_pattern_service.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { IndexPatternsFetcher } from '../../../../../plugins/data/server/';
-export const getIndexPatternService = {
- assign: 'indexPatternsService',
- method(req) {
- const dataCluster = req.server.plugins.elasticsearch.getCluster('data');
- const callDataCluster = (...args) => {
- return dataCluster.callWithRequest(req, ...args);
- };
- return new IndexPatternsFetcher(callDataCluster);
- },
-};
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/index.js b/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/index.js
deleted file mode 100644
index 512894f30a619d..00000000000000
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/index.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export { SearchStrategiesRegister } from './search_strategies_register';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.js b/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.js
deleted file mode 100644
index 794e92a1954a92..00000000000000
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export class AbstractSearchStrategy {
- constructor(server, callWithRequestFactory, SearchRequest) {
- this.getCallWithRequestInstance = req => callWithRequestFactory(server, req);
-
- this.getSearchRequest = req => {
- const callWithRequest = this.getCallWithRequestInstance(req);
-
- return new SearchRequest(req, callWithRequest);
- };
- }
-
- async getFieldsForWildcard(req, indexPattern) {
- const { indexPatternsService } = req.pre;
-
- return await indexPatternsService.getFieldsForWildcard({
- pattern: indexPattern,
- });
- }
-
- checkForViability() {
- throw new TypeError('Must override method');
- }
-}
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/__snapshots__/model_options.test.js.snap b/src/plugins/vis_type_timeseries/common/__snapshots__/model_options.test.js.snap
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/__snapshots__/model_options.test.js.snap
rename to src/plugins/vis_type_timeseries/common/__snapshots__/model_options.test.js.snap
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/agg_lookup.js b/src/plugins/vis_type_timeseries/common/agg_lookup.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/agg_lookup.js
rename to src/plugins/vis_type_timeseries/common/agg_lookup.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/agg_lookup.test.js b/src/plugins/vis_type_timeseries/common/agg_lookup.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/agg_lookup.test.js
rename to src/plugins/vis_type_timeseries/common/agg_lookup.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/basic_aggs.js b/src/plugins/vis_type_timeseries/common/basic_aggs.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/basic_aggs.js
rename to src/plugins/vis_type_timeseries/common/basic_aggs.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/calculate_label.js b/src/plugins/vis_type_timeseries/common/calculate_label.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/calculate_label.js
rename to src/plugins/vis_type_timeseries/common/calculate_label.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/calculate_label.test.js b/src/plugins/vis_type_timeseries/common/calculate_label.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/calculate_label.test.js
rename to src/plugins/vis_type_timeseries/common/calculate_label.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/extract_index_patterns.js b/src/plugins/vis_type_timeseries/common/extract_index_patterns.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/extract_index_patterns.js
rename to src/plugins/vis_type_timeseries/common/extract_index_patterns.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/extract_index_patterns.test.js b/src/plugins/vis_type_timeseries/common/extract_index_patterns.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/extract_index_patterns.test.js
rename to src/plugins/vis_type_timeseries/common/extract_index_patterns.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/field_types.js b/src/plugins/vis_type_timeseries/common/field_types.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/field_types.js
rename to src/plugins/vis_type_timeseries/common/field_types.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/get_last_value.js b/src/plugins/vis_type_timeseries/common/get_last_value.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/get_last_value.js
rename to src/plugins/vis_type_timeseries/common/get_last_value.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/get_last_value.test.js b/src/plugins/vis_type_timeseries/common/get_last_value.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/get_last_value.test.js
rename to src/plugins/vis_type_timeseries/common/get_last_value.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/interval_regexp.js b/src/plugins/vis_type_timeseries/common/interval_regexp.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/interval_regexp.js
rename to src/plugins/vis_type_timeseries/common/interval_regexp.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/interval_regexp.test.js b/src/plugins/vis_type_timeseries/common/interval_regexp.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/interval_regexp.test.js
rename to src/plugins/vis_type_timeseries/common/interval_regexp.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/metric_types.js b/src/plugins/vis_type_timeseries/common/metric_types.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/metric_types.js
rename to src/plugins/vis_type_timeseries/common/metric_types.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/model_options.js b/src/plugins/vis_type_timeseries/common/model_options.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/model_options.js
rename to src/plugins/vis_type_timeseries/common/model_options.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/model_options.test.js b/src/plugins/vis_type_timeseries/common/model_options.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/model_options.test.js
rename to src/plugins/vis_type_timeseries/common/model_options.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/panel_types.js b/src/plugins/vis_type_timeseries/common/panel_types.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/panel_types.js
rename to src/plugins/vis_type_timeseries/common/panel_types.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/timerange_data_modes.js b/src/plugins/vis_type_timeseries/common/timerange_data_modes.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/timerange_data_modes.js
rename to src/plugins/vis_type_timeseries/common/timerange_data_modes.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/to_percentile_number.js b/src/plugins/vis_type_timeseries/common/to_percentile_number.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/to_percentile_number.js
rename to src/plugins/vis_type_timeseries/common/to_percentile_number.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/ui_restrictions.js b/src/plugins/vis_type_timeseries/common/ui_restrictions.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/common/ui_restrictions.js
rename to src/plugins/vis_type_timeseries/common/ui_restrictions.js
diff --git a/src/plugins/vis_type_timeseries/server/index.ts b/src/plugins/vis_type_timeseries/server/index.ts
index dfb2394af237bf..fa74b6e9659710 100644
--- a/src/plugins/vis_type_timeseries/server/index.ts
+++ b/src/plugins/vis_type_timeseries/server/index.ts
@@ -32,6 +32,13 @@ export type VisTypeTimeseriesConfig = TypeOf;
export { ValidationTelemetryServiceSetup } from './validation_telemetry';
+// @ts-ignore
+export { AbstractSearchStrategy } from './lib/search_strategies/strategies/abstract_search_strategy';
+// @ts-ignore
+export { AbstractSearchRequest } from './lib/search_strategies/search_requests/abstract_request';
+// @ts-ignore
+export { DefaultSearchCapabilities } from './lib/search_strategies/default_search_capabilities';
+
export function plugin(initializerContext: PluginInitializerContext) {
return new VisTypeTimeseriesPlugin(initializerContext);
}
diff --git a/src/plugins/vis_type_timeseries/server/lib/get_fields.ts b/src/plugins/vis_type_timeseries/server/lib/get_fields.ts
new file mode 100644
index 00000000000000..8eca30dae7773a
--- /dev/null
+++ b/src/plugins/vis_type_timeseries/server/lib/get_fields.ts
@@ -0,0 +1,89 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { uniq } from 'lodash';
+import { first, map } from 'rxjs/operators';
+import { KibanaRequest, RequestHandlerContext } from 'kibana/server';
+
+// @ts-ignore
+import { getIndexPatternObject } from './vis_data/helpers/get_index_pattern';
+import { isNestedField } from '../../../data/server';
+import { Framework } from '../plugin';
+import { FieldDescriptor, IndexPatternsFetcher } from '../../../data/server';
+import { ReqFacade } from './search_strategies/strategies/abstract_search_strategy';
+
+export async function getFields(
+ requestContext: RequestHandlerContext,
+ request: KibanaRequest,
+ framework: Framework,
+ indexPattern: string
+) {
+ // NOTE / TODO: This facade has been put in place to make migrating to the New Platform easier. It
+ // removes the need to refactor many layers of dependencies on "req", and instead just augments the top
+ // level object passed from here. The layers should be refactored fully at some point, but for now
+ // this works and we are still using the New Platform services for these vis data portions.
+ const reqFacade: ReqFacade = {
+ ...request,
+ framework,
+ payload: {},
+ pre: {
+ indexPatternsService: new IndexPatternsFetcher(
+ requestContext.core.elasticsearch.dataClient.callAsCurrentUser
+ ),
+ },
+ getUiSettingsService: () => requestContext.core.uiSettings.client,
+ getSavedObjectsClient: () => requestContext.core.savedObjects.client,
+ server: {
+ plugins: {
+ elasticsearch: {
+ getCluster: () => {
+ return {
+ callWithRequest: async (req: any, endpoint: string, params: any) => {
+ return await requestContext.core.elasticsearch.dataClient.callAsCurrentUser(
+ endpoint,
+ params
+ );
+ },
+ };
+ },
+ },
+ },
+ },
+ getEsShardTimeout: async () => {
+ return await framework.globalConfig$
+ .pipe(
+ first(),
+ map(config => config.elasticsearch.shardTimeout.asMilliseconds())
+ )
+ .toPromise();
+ },
+ };
+ const { indexPatternString } = await getIndexPatternObject(reqFacade, indexPattern);
+ const {
+ searchStrategy,
+ capabilities,
+ } = (await framework.searchStrategyRegistry.getViableStrategy(reqFacade, indexPatternString))!;
+
+ const fields = ((await searchStrategy.getFieldsForWildcard(
+ reqFacade,
+ indexPatternString,
+ capabilities
+ )) as FieldDescriptor[]).filter(field => field.aggregatable && !isNestedField(field));
+
+ return uniq(fields, field => field.name);
+}
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/get_vis_data.ts b/src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts
similarity index 87%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/get_vis_data.ts
rename to src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts
index 58e624fa134429..aef831eaad4302 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/get_vis_data.ts
+++ b/src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts
@@ -17,11 +17,12 @@
* under the License.
*/
-import { RequestHandlerContext } from 'src/core/server';
+import { FakeRequest, RequestHandlerContext } from 'kibana/server';
import _ from 'lodash';
import { first, map } from 'rxjs/operators';
import { getPanelData } from './vis_data/get_panel_data';
-import { Framework } from '../../../../../plugins/vis_type_timeseries/server';
+import { Framework } from '../index';
+import { ReqFacade } from './search_strategies/strategies/abstract_search_strategy';
interface GetVisDataResponse {
[key: string]: GetVisDataPanel;
@@ -56,15 +57,18 @@ export type GetVisData = (
export function getVisData(
requestContext: RequestHandlerContext,
- options: GetVisDataOptions,
+ request: FakeRequest & { body: GetVisDataOptions },
framework: Framework
): Promise {
// NOTE / TODO: This facade has been put in place to make migrating to the New Platform easier. It
// removes the need to refactor many layers of dependencies on "req", and instead just augments the top
// level object passed from here. The layers should be refactored fully at some point, but for now
// this works and we are still using the New Platform services for these vis data portions.
- const reqFacade: any = {
- payload: options,
+ const reqFacade: ReqFacade = {
+ ...request,
+ framework,
+ pre: {},
+ payload: request.body,
getUiSettingsService: () => requestContext.core.uiSettings.client,
getSavedObjectsClient: () => requestContext.core.savedObjects.client,
server: {
@@ -92,7 +96,7 @@ export function getVisData(
.toPromise();
},
};
- const promises = reqFacade.payload.panels.map(getPanelData(reqFacade));
+ const promises = (reqFacade.payload as GetVisDataOptions).panels.map(getPanelData(reqFacade));
return Promise.all(promises).then(res => {
return res.reduce((acc, data) => {
return _.assign(acc as any, data);
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.test.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.test.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/default_search_capabilities.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/index.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/index.ts
similarity index 87%
rename from src/legacy/core_plugins/vis_type_timeseries/server/index.ts
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/index.ts
index c010628ca04bfd..d53683882252b5 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/index.ts
+++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/index.ts
@@ -17,5 +17,4 @@
* under the License.
*/
-export { init } from './init';
-export { getVisData, GetVisData, GetVisDataOptions } from './lib/get_vis_data';
+export { SearchStrategyRegistry } from './search_strategy_registry';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/abstract_request.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/abstract_request.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/abstract_request.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/abstract_request.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/abstract_request.test.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/abstract_request.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/abstract_request.test.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/abstract_request.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/multi_search_request.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/multi_search_request.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/multi_search_request.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/multi_search_request.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/multi_search_request.test.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/multi_search_request.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/multi_search_request.test.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/multi_search_request.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/search_request.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/search_request.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/search_request.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/search_request.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/search_request.test.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/search_request.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/search_request.test.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/search_request.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/single_search_request.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/single_search_request.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/single_search_request.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/single_search_request.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/single_search_request.test.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/single_search_request.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/searh_requests/single_search_request.test.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_requests/single_search_request.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_register.test.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_registry.test.ts
similarity index 61%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_register.test.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_registry.test.ts
index e03d776b8ee0c7..ecd09653b3b489 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_register.test.js
+++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_registry.test.ts
@@ -16,10 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { SearchStrategiesRegister } from './search_strategies_register';
+
+import { SearchStrategyRegistry } from './search_strategy_registry';
+// @ts-ignore
import { AbstractSearchStrategy } from './strategies/abstract_search_strategy';
+// @ts-ignore
import { DefaultSearchStrategy } from './strategies/default_search_strategy';
-import { AbstractSearchRequest } from './searh_requests/abstract_request';
+// @ts-ignore
import { DefaultSearchCapabilities } from './default_search_capabilities';
class MockSearchStrategy extends AbstractSearchStrategy {
@@ -31,34 +34,21 @@ class MockSearchStrategy extends AbstractSearchStrategy {
}
}
-describe('SearchStrategiesRegister', () => {
- let server;
- let strategies;
- let anotherSearchStrategy;
+describe('SearchStrategyRegister', () => {
+ let registry: SearchStrategyRegistry;
beforeAll(() => {
- server = {
- expose: jest.fn((strategy, func) => {
- server[strategy] = func;
- }),
- };
- strategies = [
- ['AbstractSearchStrategy', AbstractSearchStrategy],
- ['AbstractSearchRequest', AbstractSearchRequest],
- ['DefaultSearchCapabilities', DefaultSearchCapabilities],
- ['addSearchStrategy', expect.any(Function)],
- ];
-
- SearchStrategiesRegister.init(server);
+ registry = new SearchStrategyRegistry();
});
test('should init strategies register', () => {
- expect(server.expose.mock.calls).toEqual(strategies);
- expect(server.addSearchStrategy()[0] instanceof DefaultSearchStrategy).toBe(true);
+ expect(
+ registry.addStrategy({} as AbstractSearchStrategy)[0] instanceof DefaultSearchStrategy
+ ).toBe(true);
});
test('should not add a strategy if it is not an instance of AbstractSearchStrategy', () => {
- const addedStrategies = server.addSearchStrategy({});
+ const addedStrategies = registry.addStrategy({} as AbstractSearchStrategy);
expect(addedStrategies.length).toEqual(1);
expect(addedStrategies[0] instanceof DefaultSearchStrategy).toBe(true);
@@ -68,18 +58,15 @@ describe('SearchStrategiesRegister', () => {
const req = {};
const indexPattern = '*';
- const { searchStrategy, capabilities } = await SearchStrategiesRegister.getViableStrategy(
- req,
- indexPattern
- );
+ const { searchStrategy, capabilities } = (await registry.getViableStrategy(req, indexPattern))!;
expect(searchStrategy instanceof DefaultSearchStrategy).toBe(true);
expect(capabilities instanceof DefaultSearchCapabilities).toBe(true);
});
test('should add a strategy if it is an instance of AbstractSearchStrategy', () => {
- anotherSearchStrategy = new MockSearchStrategy();
- const addedStrategies = server.addSearchStrategy(anotherSearchStrategy);
+ const anotherSearchStrategy = new MockSearchStrategy({}, {} as any, {});
+ const addedStrategies = registry.addStrategy(anotherSearchStrategy);
expect(addedStrategies.length).toEqual(2);
expect(addedStrategies[0] instanceof AbstractSearchStrategy).toBe(true);
@@ -88,13 +75,12 @@ describe('SearchStrategiesRegister', () => {
test('should return a MockSearchStrategy instance', async () => {
const req = {};
const indexPattern = '*';
+ const anotherSearchStrategy = new MockSearchStrategy({}, {} as any, {});
+ registry.addStrategy(anotherSearchStrategy);
- const { searchStrategy, capabilities } = await SearchStrategiesRegister.getViableStrategy(
- req,
- indexPattern
- );
+ const { searchStrategy, capabilities } = (await registry.getViableStrategy(req, indexPattern))!;
- expect(searchStrategy instanceof AbstractSearchStrategy).toBe(true);
+ expect(searchStrategy instanceof MockSearchStrategy).toBe(true);
expect(capabilities).toEqual({});
});
});
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_register.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategy_registry.ts
similarity index 57%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_register.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategy_registry.ts
index 5fbb4060862a42..6fbed1ddfba0f3 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_register.js
+++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategy_registry.ts
@@ -16,34 +16,32 @@
* specific language governing permissions and limitations
* under the License.
*/
+
import { AbstractSearchStrategy } from './strategies/abstract_search_strategy';
-import { AbstractSearchRequest } from './searh_requests/abstract_request';
+// @ts-ignore
import { DefaultSearchStrategy } from './strategies/default_search_strategy';
-import { DefaultSearchCapabilities } from './default_search_capabilities';
-
+// @ts-ignore
import { extractIndexPatterns } from '../../../common/extract_index_patterns';
-const strategies = [];
+export type RequestFacade = any;
+export type Panel = any;
-const addStrategy = searchStrategy => {
- if (searchStrategy instanceof AbstractSearchStrategy) {
- strategies.unshift(searchStrategy);
- }
- return strategies;
-};
+export class SearchStrategyRegistry {
+ private strategies: AbstractSearchStrategy[] = [];
-export class SearchStrategiesRegister {
- static init(server) {
- server.expose('AbstractSearchStrategy', AbstractSearchStrategy);
- server.expose('AbstractSearchRequest', AbstractSearchRequest);
- server.expose('DefaultSearchCapabilities', DefaultSearchCapabilities);
- server.expose('addSearchStrategy', searchStrategy => addStrategy(searchStrategy));
+ constructor() {
+ this.addStrategy(new DefaultSearchStrategy());
+ }
- addStrategy(new DefaultSearchStrategy(server));
+ public addStrategy(searchStrategy: AbstractSearchStrategy) {
+ if (searchStrategy instanceof AbstractSearchStrategy) {
+ this.strategies.unshift(searchStrategy);
+ }
+ return this.strategies;
}
- static async getViableStrategy(req, indexPattern) {
- for (const searchStrategy of strategies) {
+ async getViableStrategy(req: RequestFacade, indexPattern: string) {
+ for (const searchStrategy of this.strategies) {
const { isViable, capabilities } = await searchStrategy.checkForViability(req, indexPattern);
if (isViable) {
@@ -55,9 +53,9 @@ export class SearchStrategiesRegister {
}
}
- static async getViableStrategyForPanel(req, panel) {
+ async getViableStrategyForPanel(req: RequestFacade, panel: Panel) {
const indexPattern = extractIndexPatterns(panel).join(',');
- return SearchStrategiesRegister.getViableStrategy(req, indexPattern);
+ return this.getViableStrategy(req, indexPattern);
}
}
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.js
diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts
new file mode 100644
index 00000000000000..4fd4ac251fa3e8
--- /dev/null
+++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts
@@ -0,0 +1,87 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+ APICaller,
+ FakeRequest,
+ IUiSettingsClient,
+ SavedObjectsClientContract,
+} from 'kibana/server';
+import { Framework } from '../../../plugin';
+import { IndexPatternsFetcher } from '../../../../../data/server';
+
+/**
+ * ReqFacade is a regular KibanaRequest object extended with additional service
+ * references to ensure backwards compatibility for existing integrations.
+ *
+ * This will be replaced by standard KibanaRequest and RequestContext objects in a later version.
+ */
+export type ReqFacade = FakeRequest & {
+ framework: Framework;
+ payload: unknown;
+ pre: {
+ indexPatternsService?: IndexPatternsFetcher;
+ };
+ getUiSettingsService: () => IUiSettingsClient;
+ getSavedObjectsClient: () => SavedObjectsClientContract;
+ server: {
+ plugins: {
+ elasticsearch: {
+ getCluster: () => {
+ callWithRequest: (req: ReqFacade, endpoint: string, params: any) => Promise;
+ };
+ };
+ };
+ };
+ getEsShardTimeout: () => Promise;
+};
+
+export class AbstractSearchStrategy {
+ public getCallWithRequestInstance: (req: ReqFacade) => APICaller;
+ public getSearchRequest: (req: ReqFacade) => any;
+
+ constructor(
+ server: any,
+ callWithRequestFactory: (server: any, req: ReqFacade) => APICaller,
+ SearchRequest: any
+ ) {
+ this.getCallWithRequestInstance = req => callWithRequestFactory(server, req);
+
+ this.getSearchRequest = req => {
+ const callWithRequest = this.getCallWithRequestInstance(req);
+
+ return new SearchRequest(req, callWithRequest);
+ };
+ }
+
+ async getFieldsForWildcard(req: ReqFacade, indexPattern: string, capabilities: any) {
+ const { indexPatternsService } = req.pre;
+
+ return await indexPatternsService!.getFieldsForWildcard({
+ pattern: indexPattern,
+ });
+ }
+
+ checkForViability(
+ req: ReqFacade,
+ indexPattern: string
+ ): { isViable: boolean; capabilities: any } {
+ throw new TypeError('Must override method');
+ }
+}
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.js
similarity index 95%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.js
index fba67f448e7849..63f2911ce11187 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.js
+++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.js
@@ -17,7 +17,7 @@
* under the License.
*/
import { AbstractSearchStrategy } from './abstract_search_strategy';
-import { SearchRequest } from '../searh_requests/search_request';
+import { SearchRequest } from '../search_requests/search_request';
import { DefaultSearchCapabilities } from '../default_search_capabilities';
const callWithRequestFactory = (server, request) => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.js b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.js
rename to src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/annorations/build_request_body.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/annotations/build_request_body.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/annorations/build_request_body.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/annotations/build_request_body.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/annorations/get_request_params.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/annotations/get_request_params.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/annorations/get_request_params.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/annotations/get_request_params.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/build_processor_function.test.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/build_processor_function.test.ts
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/build_processor_function.test.ts
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/build_processor_function.test.ts
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/build_processor_function.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/build_processor_function.ts
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/build_processor_function.ts
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/build_processor_function.ts
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_annotations.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_annotations.js
similarity index 96%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_annotations.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/get_annotations.js
index 898ff837d4a012..8b8c31912f168c 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_annotations.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_annotations.js
@@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { handleAnnotationResponse } from './response_processors/annotations/';
-import { getAnnotationRequestParams } from './annorations/get_request_params';
+import { handleAnnotationResponse } from './response_processors/annotations';
+import { getAnnotationRequestParams } from './annotations/get_request_params';
import { getLastSeriesTimestamp } from './helpers/timestamp';
function validAnnotation(annotation) {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_panel_data.d.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_panel_data.d.ts
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_panel_data.d.ts
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/get_panel_data.d.ts
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_panel_data.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_panel_data.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_panel_data.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/get_panel_data.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js
similarity index 91%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js
index b4eb9e6b108ff7..1efeccb4b5701f 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.js
@@ -20,15 +20,14 @@ import { getSeriesRequestParams } from './series/get_request_params';
import { handleResponseBody } from './series/handle_response_body';
import { handleErrorResponse } from './handle_error_response';
import { getAnnotations } from './get_annotations';
-import { SearchStrategiesRegister } from '../search_strategies/search_strategies_register';
import { getEsQueryConfig } from './helpers/get_es_query_uisettings';
import { getActiveSeries } from './helpers/get_active_series';
export async function getSeriesData(req, panel) {
- const { searchStrategy, capabilities } = await SearchStrategiesRegister.getViableStrategyForPanel(
- req,
- panel
- );
+ const {
+ searchStrategy,
+ capabilities,
+ } = await req.framework.searchStrategyRegistry.getViableStrategyForPanel(req, panel);
const searchRequest = searchStrategy.getSearchRequest(req);
const esQueryConfig = await getEsQueryConfig(req);
const meta = {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js
similarity index 90%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js
index 2c92692d2bd1ff..1d1c2459079591 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.js
@@ -20,16 +20,16 @@ import { buildRequestBody } from './table/build_request_body';
import { handleErrorResponse } from './handle_error_response';
import { get } from 'lodash';
import { processBucket } from './table/process_bucket';
-import { SearchStrategiesRegister } from '../search_strategies/search_strategies_register';
import { getEsQueryConfig } from './helpers/get_es_query_uisettings';
import { getIndexPatternObject } from './helpers/get_index_pattern';
export async function getTableData(req, panel) {
const panelIndexPattern = panel.index_pattern;
- const { searchStrategy, capabilities } = await SearchStrategiesRegister.getViableStrategy(
- req,
- panelIndexPattern
- );
+
+ const {
+ searchStrategy,
+ capabilities,
+ } = await req.framework.searchStrategyRegistry.getViableStrategy(req, panelIndexPattern);
const searchRequest = searchStrategy.getSearchRequest(req);
const esQueryConfig = await getEsQueryConfig(req);
const { indexPatternObject } = await getIndexPatternObject(req, panelIndexPattern);
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/handle_error_response.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/handle_error_response.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/handle_error_response.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/handle_error_response.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/__snapshots__/bucket_transform.test.js.snap b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/__snapshots__/bucket_transform.test.js.snap
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/__snapshots__/bucket_transform.test.js.snap
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/__snapshots__/bucket_transform.test.js.snap
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/bucket_transform.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/calculate_auto.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/calculate_auto.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/calculate_auto.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/calculate_auto.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/format_key.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/format_key.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/format_key.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/format_key.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_active_series.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_active_series.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_active_series.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_active_series.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_agg_value.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.js
similarity index 97%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.js
index de23b90b21d6c0..3ec5454fcee778 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.js
@@ -24,7 +24,7 @@ import {
convertIntervalToUnit,
ASCENDING_UNIT_ORDER,
} from './unit_to_seconds';
-import { getTimerangeDuration } from '../helpers/get_timerange';
+import { getTimerangeDuration } from './get_timerange';
import { INTERVAL_STRING_RE, GTE_INTERVAL_RE } from '../../../../common/interval_regexp';
const calculateBucketData = (timeInterval, capabilities) => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_bucket_size.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_buckets_path.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_default_decoration.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_query_uisettings.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_query_uisettings.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_query_uisettings.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_query_uisettings.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_es_shard_timeout.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_index_pattern.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_index_pattern.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_index_pattern.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_index_pattern.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_last_metric.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_sibling_agg_value.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_split_colors.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_split_colors.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_split_colors.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_split_colors.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange_mode.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange_mode.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange_mode.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_timerange_mode.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/index.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/index.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/index.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/index.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/map_bucket.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/moving_fn_scripts.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_interval.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_interval.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_interval.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_interval.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/parse_settings.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/timestamp.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/offset_time.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/offset_time.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/offset_time.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/offset_time.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/offset_time.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/offset_time.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/offset_time.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/offset_time.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js
similarity index 94%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js
index 5a763ce35e35e1..995790c590e424 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js
@@ -18,7 +18,7 @@
*/
import _ from 'lodash';
-import { dateHistogramInterval } from '../../../../../../data/server';
+import { dateHistogramInterval } from '../../../../../../../legacy/core_plugins/data/server';
import { getBucketSize } from '../../helpers/get_bucket_size';
import { getTimerange } from '../../helpers/get_timerange';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/index.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/index.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/index.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/index.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js
similarity index 97%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js
index d6514e3bc45d4d..a4817dac9bd186 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js
@@ -19,7 +19,7 @@
import { getBucketSize } from '../../helpers/get_bucket_size';
import { getTimerange } from '../../helpers/get_timerange';
-import { esQuery } from '../../../../../../../../plugins/data/server';
+import { esQuery } from '../../../../../../data/server';
export function query(req, panel, annotation, esQueryConfig, indexPattern, capabilities) {
return next => doc => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js
similarity index 96%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js
index 3b55e2bf4c1516..48da5ac19aa3ae 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js
@@ -18,7 +18,7 @@
*/
import { set } from 'lodash';
-import { dateHistogramInterval } from '../../../../../../data/server';
+import { dateHistogramInterval } from '../../../../../../../legacy/core_plugins/data/server';
import { getBucketSize } from '../../helpers/get_bucket_size';
import { offsetTime } from '../../offset_time';
import { getIntervalAndTimefield } from '../../get_interval_and_timefield';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/filter_ratios.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/index.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/index.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/index.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/index.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/metric_buckets.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/normalize_query.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.js
similarity index 96%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.js
index 53f894322a8e08..e5b81912f286ef 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.js
@@ -19,7 +19,7 @@
import { offsetTime } from '../../offset_time';
import { getIntervalAndTimefield } from '../../get_interval_and_timefield';
-import { esQuery } from '../../../../../../../../plugins/data/server';
+import { esQuery } from '../../../../../../data/server';
export function query(req, panel, series, esQueryConfig, indexPatternObject) {
return next => doc => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/query.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/sibling_buckets.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_everything.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.js
similarity index 94%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.js
index 1548c9e17c2e18..80b4ef70a3f085 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.js
@@ -18,7 +18,7 @@
*/
import { set } from 'lodash';
-import { esQuery } from '../../../../../../../../plugins/data/server';
+import { esQuery } from '../../../../../../data/server';
export function splitByFilter(req, panel, series, esQueryConfig, indexPattern) {
return next => doc => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filter.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.js
similarity index 94%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.js
index 4295bceed43cc7..d023c28cdb25ef 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.js
@@ -18,7 +18,7 @@
*/
import { set } from 'lodash';
-import { esQuery } from '../../../../../../../../plugins/data/server';
+import { esQuery } from '../../../../../../data/server';
export function splitByFilters(req, panel, series, esQueryConfig, indexPattern) {
return next => doc => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_filters.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/calculate_agg_root.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/calculate_agg_root.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/calculate_agg_root.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/calculate_agg_root.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js
similarity index 96%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js
index 183785fab9be17..f33ce145aa2309 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js
@@ -18,7 +18,7 @@
*/
import { set } from 'lodash';
-import { dateHistogramInterval } from '../../../../../../data/server';
+import { dateHistogramInterval } from '../../../../../../../legacy/core_plugins/data/server';
import { getBucketSize } from '../../helpers/get_bucket_size';
import { isLastValueTimerangeMode } from '../../helpers/get_timerange_mode';
import { getIntervalAndTimefield } from '../../get_interval_and_timefield';
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/filter_ratios.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/filter_ratios.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/filter_ratios.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/filter_ratios.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/index.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/index.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/index.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/index.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/metric_buckets.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/metric_buckets.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/metric_buckets.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/metric_buckets.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/normalize_query.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/pivot.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/pivot.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/pivot.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/pivot.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/query.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/query.js
similarity index 96%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/query.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/query.js
index 9d46c212e05bd1..d8d948e01cccd9 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/query.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/query.js
@@ -18,7 +18,7 @@
*/
import { getTimerange } from '../../helpers/get_timerange';
import { getIntervalAndTimefield } from '../../get_interval_and_timefield';
-import { esQuery } from '../../../../../../../../plugins/data/server';
+import { esQuery } from '../../../../../../data/server';
export function query(req, panel, esQueryConfig, indexPatternObject) {
return next => doc => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/sibling_buckets.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/sibling_buckets.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/sibling_buckets.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/sibling_buckets.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_everything.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_everything.js
similarity index 95%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_everything.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_everything.js
index 17f99ea431fd37..35036abed320f9 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_everything.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_everything.js
@@ -18,7 +18,7 @@
*/
import { set } from 'lodash';
-import { esQuery } from '../../../../../../../../plugins/data/server';
+import { esQuery } from '../../../../../../data/server';
export function splitByEverything(req, panel, esQueryConfig, indexPattern) {
return next => doc => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_terms.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_terms.js
similarity index 95%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_terms.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_terms.js
index 042e4d98e27675..5b7ae735cd50f5 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_terms.js
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/split_by_terms.js
@@ -18,7 +18,7 @@
*/
import { set } from 'lodash';
-import { esQuery } from '../../../../../../../../plugins/data/server';
+import { esQuery } from '../../../../../../data/server';
export function splitByTerms(req, panel, esQueryConfig, indexPattern) {
return next => doc => {
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/buckets.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/buckets.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/buckets.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/buckets.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/filter.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/index.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/index.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/index.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/annotations/index.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/_series_agg.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/drop_last_bucket.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/drop_last_bucket.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/drop_last_bucket.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/drop_last_bucket.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/math.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/math.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/math.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/math.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/percentile_rank.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/series_agg.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_metric.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_sibling.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.test.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.test.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/time_shift.test.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/_series_agg.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/_series_agg.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/_series_agg.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/_series_agg.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/drop_last_bucket.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/drop_last_bucket.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/drop_last_bucket.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/drop_last_bucket.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/index.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/index.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/index.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/index.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/math.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/math.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/math.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/math.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile_rank.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile_rank.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile_rank.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/percentile_rank.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/series_agg.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/series_agg.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/series_agg.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/series_agg.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_metric.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_metric.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_metric.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_metric.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_sibling.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_sibling.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_sibling.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/table/std_sibling.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.test.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.test.ts
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.test.ts
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.test.ts
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.ts
similarity index 95%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.ts
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.ts
index 85e1f8f7eb12b2..9d8f3fca789f09 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.ts
+++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/series/build_request_body.ts
@@ -19,7 +19,7 @@
import { buildProcessorFunction } from '../build_processor_function';
// @ts-ignore
-import { processors } from '../request_processors/series';
+import { processors } from '../request_processors/series/index';
/**
* Builds series request body
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/get_request_params.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/series/get_request_params.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/get_request_params.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/series/get_request_params.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/table/build_request_body.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/table/build_request_body.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/table/build_request_body.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/table/build_request_body.js
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/table/process_bucket.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/table/process_bucket.js
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/lib/vis_data/table/process_bucket.js
rename to src/plugins/vis_type_timeseries/server/lib/vis_data/table/process_bucket.js
diff --git a/src/plugins/vis_type_timeseries/server/plugin.ts b/src/plugins/vis_type_timeseries/server/plugin.ts
index dcd0cd500bbc31..6ef6362c6e37be 100644
--- a/src/plugins/vis_type_timeseries/server/plugin.ts
+++ b/src/plugins/vis_type_timeseries/server/plugin.ts
@@ -24,19 +24,19 @@ import {
Plugin,
RequestHandlerContext,
Logger,
+ IRouter,
+ FakeRequest,
} from 'src/core/server';
import { Observable } from 'rxjs';
import { Server } from 'hapi';
-import { once } from 'lodash';
import { VisTypeTimeseriesConfig } from '.';
-import {
- init,
- getVisData,
- GetVisData,
- GetVisDataOptions,
-} from '../../../legacy/core_plugins/vis_type_timeseries/server';
-import { ValidationTelemetryService } from './validation_telemetry/validation_telemetry_service';
+import { getVisData, GetVisData, GetVisDataOptions } from './lib/get_vis_data';
+import { ValidationTelemetryService } from './validation_telemetry';
import { UsageCollectionSetup } from '../../usage_collection/server';
+import { visDataRoutes } from './routes/vis';
+// @ts-ignore
+import { fieldsRoutes } from './routes/fields';
+import { SearchStrategyRegistry } from './lib/search_strategies';
export interface LegacySetup {
server: Server;
@@ -47,15 +47,12 @@ interface VisTypeTimeseriesPluginSetupDependencies {
}
export interface VisTypeTimeseriesSetup {
- /** @deprecated */
- __legacy: {
- config$: Observable;
- registerLegacyAPI: (__LEGACY: LegacySetup) => void;
- };
getVisData: (
requestContext: RequestHandlerContext,
+ fakeRequest: FakeRequest,
options: GetVisDataOptions
) => ReturnType;
+ addSearchStrategy: SearchStrategyRegistry['addStrategy'];
}
export interface Framework {
@@ -64,6 +61,8 @@ export interface Framework {
config$: Observable;
globalConfig$: PluginInitializerContext['config']['legacy']['globalConfig$'];
logger: Logger;
+ router: IRouter;
+ searchStrategyRegistry: SearchStrategyRegistry;
}
export class VisTypeTimeseriesPlugin implements Plugin {
@@ -79,6 +78,9 @@ export class VisTypeTimeseriesPlugin implements Plugin {
const config$ = this.initializerContext.config.create();
// Global config contains things like the ES shard timeout
const globalConfig$ = this.initializerContext.config.legacy.globalConfig$;
+ const router = core.http.createRouter();
+
+ const searchStrategyRegistry = new SearchStrategyRegistry();
const framework: Framework = {
core,
@@ -86,23 +88,29 @@ export class VisTypeTimeseriesPlugin implements Plugin {
config$,
globalConfig$,
logger,
+ router,
+ searchStrategyRegistry,
};
- return {
- __legacy: {
- config$,
- registerLegacyAPI: once(async (__LEGACY: LegacySetup) => {
- const validationTelemetrySetup = await this.validationTelementryService.setup(core, {
- ...plugins,
- globalConfig$,
- });
+ (async () => {
+ const validationTelemetry = await this.validationTelementryService.setup(core, {
+ ...plugins,
+ globalConfig$,
+ });
+ visDataRoutes(router, framework, validationTelemetry);
- await init(framework, __LEGACY, validationTelemetrySetup);
- }),
- },
- getVisData: async (requestContext: RequestHandlerContext, options: GetVisDataOptions) => {
- return await getVisData(requestContext, options, framework);
+ fieldsRoutes(framework);
+ })();
+
+ return {
+ getVisData: async (
+ requestContext: RequestHandlerContext,
+ fakeRequest: FakeRequest,
+ options: GetVisDataOptions
+ ) => {
+ return await getVisData(requestContext, { ...fakeRequest, body: options }, framework);
},
+ addSearchStrategy: searchStrategyRegistry.addStrategy.bind(searchStrategyRegistry),
};
}
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/routes/fields.js b/src/plugins/vis_type_timeseries/server/routes/fields.ts
similarity index 54%
rename from src/legacy/core_plugins/vis_type_timeseries/server/routes/fields.js
rename to src/plugins/vis_type_timeseries/server/routes/fields.ts
index d984868afb0b04..255c85c9eefa7f 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/routes/fields.js
+++ b/src/plugins/vis_type_timeseries/server/routes/fields.ts
@@ -17,26 +17,35 @@
* under the License.
*/
+import { isBoom } from 'boom';
+import { schema } from '@kbn/config-schema';
import { getFields } from '../lib/get_fields';
-import { getIndexPatternService } from '../lib/get_index_pattern_service';
+import { Framework } from '../plugin';
-export const fieldsRoutes = server => {
- server.route({
- config: {
- pre: [getIndexPatternService],
+export const fieldsRoutes = (framework: Framework) => {
+ framework.router.get(
+ {
+ path: '/api/metrics/fields',
+ validate: {
+ query: schema.object({ index: schema.string() }),
+ },
},
- path: '/api/metrics/fields',
- method: 'GET',
- handler: async req => {
+ async (context, req, res) => {
try {
- return await getFields(req);
+ return res.ok({ body: await getFields(context, req, framework, req.query.index) });
} catch (err) {
- if (err.isBoom && err.status === 401) {
- return err;
+ if (isBoom(err) && err.output.statusCode === 401) {
+ return res.customError({
+ body: err.output.payload,
+ statusCode: err.output.statusCode,
+ headers: err.output.headers,
+ });
}
- return [];
+ return res.ok({
+ body: [],
+ });
}
- },
- });
+ }
+ );
};
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/routes/post_vis_schema.ts b/src/plugins/vis_type_timeseries/server/routes/post_vis_schema.ts
similarity index 100%
rename from src/legacy/core_plugins/vis_type_timeseries/server/routes/post_vis_schema.ts
rename to src/plugins/vis_type_timeseries/server/routes/post_vis_schema.ts
diff --git a/src/legacy/core_plugins/vis_type_timeseries/server/routes/vis.ts b/src/plugins/vis_type_timeseries/server/routes/vis.ts
similarity index 85%
rename from src/legacy/core_plugins/vis_type_timeseries/server/routes/vis.ts
rename to src/plugins/vis_type_timeseries/server/routes/vis.ts
index 32e87f5a3f666a..e2d1e4d114ad5d 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/server/routes/vis.ts
+++ b/src/plugins/vis_type_timeseries/server/routes/vis.ts
@@ -17,14 +17,11 @@
* under the License.
*/
-import { IRouter } from 'kibana/server';
+import { IRouter, KibanaRequest } from 'kibana/server';
import { schema } from '@kbn/config-schema';
-import { getVisData } from '../lib/get_vis_data';
+import { getVisData, GetVisDataOptions } from '../lib/get_vis_data';
import { visPayloadSchema } from './post_vis_schema';
-import {
- Framework,
- ValidationTelemetryServiceSetup,
-} from '../../../../../plugins/vis_type_timeseries/server';
+import { Framework, ValidationTelemetryServiceSetup } from '../index';
const escapeHatch = schema.object({}, { allowUnknowns: true });
@@ -52,7 +49,11 @@ export const visDataRoutes = (
);
}
try {
- const results = await getVisData(requestContext, request.body, framework);
+ const results = await getVisData(
+ requestContext,
+ request as KibanaRequest<{}, {}, GetVisDataOptions>,
+ framework
+ );
return response.ok({ body: results });
} catch (error) {
return response.internalError({
diff --git a/x-pack/legacy/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/legacy/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts
index 4409667d8390a4..4b1aa774a523ff 100644
--- a/x-pack/legacy/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts
+++ b/x-pack/legacy/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts
@@ -241,6 +241,7 @@ export class KibanaFramework {
public async makeTSVBRequest(
requestContext: RequestHandlerContext,
+ rawRequest: KibanaRequest,
model: TSVBMetricModel,
timerange: { min: number; max: number },
filters: any[]
@@ -254,6 +255,6 @@ export class KibanaFramework {
panels: [model],
filters,
};
- return getVisData(requestContext, options);
+ return getVisData(requestContext, rawRequest, options);
}
}
diff --git a/x-pack/legacy/plugins/infra/server/lib/adapters/metrics/kibana_metrics_adapter.ts b/x-pack/legacy/plugins/infra/server/lib/adapters/metrics/kibana_metrics_adapter.ts
index eb5ac05644a227..5a5f9d0f8f5293 100644
--- a/x-pack/legacy/plugins/infra/server/lib/adapters/metrics/kibana_metrics_adapter.ts
+++ b/x-pack/legacy/plugins/infra/server/lib/adapters/metrics/kibana_metrics_adapter.ts
@@ -51,7 +51,7 @@ export class KibanaMetricsAdapter implements InfraMetricsAdapter {
}
const requests = options.metrics.map(metricId =>
- this.makeTSVBRequest(metricId, options, nodeField, requestContext)
+ this.makeTSVBRequest(metricId, options, nodeField, requestContext, rawRequest)
);
return Promise.all(requests)
@@ -93,7 +93,8 @@ export class KibanaMetricsAdapter implements InfraMetricsAdapter {
metricId: InventoryMetric,
options: InfraMetricsRequestOptions,
nodeField: string,
- requestContext: RequestHandlerContext
+ requestContext: RequestHandlerContext,
+ rawRequest: KibanaRequest
) {
const createTSVBModel = get(metrics, ['tsvb', metricId]) as TSVBMetricModelCreator | undefined;
if (!createTSVBModel) {
@@ -152,6 +153,6 @@ export class KibanaMetricsAdapter implements InfraMetricsAdapter {
? [{ match: { [model.map_field_to]: id } }]
: [{ match: { [nodeField]: id } }];
- return this.framework.makeTSVBRequest(requestContext, model, timerange, filters);
+ return this.framework.makeTSVBRequest(requestContext, rawRequest, model, timerange, filters);
}
}
diff --git a/x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts b/x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts
index 8ab3fdccbe72b8..347feca67aa99c 100644
--- a/x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts
+++ b/x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts
@@ -76,7 +76,13 @@ export const populateSeriesWithTSVBData = (
}
// Get TSVB results using the model, timerange and filters
- const tsvbResults = await framework.makeTSVBRequest(requestContext, model, timerange, filters);
+ const tsvbResults = await framework.makeTSVBRequest(
+ requestContext,
+ request,
+ model,
+ timerange,
+ filters
+ );
// If there is no data `custom` will not exist.
if (!tsvbResults.custom) {
diff --git a/x-pack/legacy/plugins/rollup/index.js b/x-pack/legacy/plugins/rollup/index.js
index a10407b19fa93b..cace3bba1592b9 100644
--- a/x-pack/legacy/plugins/rollup/index.js
+++ b/x-pack/legacy/plugins/rollup/index.js
@@ -60,7 +60,7 @@ export function rollup(kibana) {
server.plugins.index_management.addIndexManagementDataEnricher(rollupDataEnricher);
}
- registerRollupSearchStrategy(this.kbnServer, server);
+ registerRollupSearchStrategy(this.kbnServer);
},
});
}
diff --git a/x-pack/legacy/plugins/rollup/server/lib/call_with_request_factory/call_with_request_factory.js b/x-pack/legacy/plugins/rollup/server/lib/call_with_request_factory/call_with_request_factory.js
index 537c5cf45ad61e..284151d404a470 100644
--- a/x-pack/legacy/plugins/rollup/server/lib/call_with_request_factory/call_with_request_factory.js
+++ b/x-pack/legacy/plugins/rollup/server/lib/call_with_request_factory/call_with_request_factory.js
@@ -8,10 +8,10 @@ import { once } from 'lodash';
import { elasticsearchJsPlugin } from '../../client/elasticsearch_rollup';
const callWithRequest = once(server => {
- const config = { plugins: [elasticsearchJsPlugin] };
- const cluster = server.plugins.elasticsearch.createCluster('rollup', config);
-
- return cluster.callWithRequest;
+ const client = server.newPlatform.setup.core.elasticsearch.createClient('rollup', {
+ plugins: [elasticsearchJsPlugin],
+ });
+ return (request, ...args) => client.asScoped(request).callAsCurrentUser(...args);
});
export const callWithRequestFactory = (server, request) => {
diff --git a/x-pack/legacy/plugins/rollup/server/lib/search_strategies/register_rollup_search_strategy.js b/x-pack/legacy/plugins/rollup/server/lib/search_strategies/register_rollup_search_strategy.js
index 5d732c8e7fbaa5..fe65a7f1f30e90 100644
--- a/x-pack/legacy/plugins/rollup/server/lib/search_strategies/register_rollup_search_strategy.js
+++ b/x-pack/legacy/plugins/rollup/server/lib/search_strategies/register_rollup_search_strategy.js
@@ -6,19 +6,19 @@
import { getRollupSearchStrategy } from './rollup_search_strategy';
import { getRollupSearchRequest } from './rollup_search_request';
import { getRollupSearchCapabilities } from './rollup_search_capabilities';
+import {
+ AbstractSearchRequest,
+ DefaultSearchCapabilities,
+ AbstractSearchStrategy,
+} from '../../../../../../../src/plugins/vis_type_timeseries/server';
-export const registerRollupSearchStrategy = (kbnServer, server) =>
+export const registerRollupSearchStrategy = kbnServer =>
kbnServer.afterPluginsInit(() => {
- if (!server.plugins.metrics) {
+ if (!kbnServer.newPlatform.setup.plugins.metrics) {
return;
}
- const {
- addSearchStrategy,
- AbstractSearchRequest,
- AbstractSearchStrategy,
- DefaultSearchCapabilities,
- } = server.plugins.metrics;
+ const { addSearchStrategy } = kbnServer.newPlatform.setup.plugins.metrics;
const RollupSearchRequest = getRollupSearchRequest(AbstractSearchRequest);
const RollupSearchCapabilities = getRollupSearchCapabilities(DefaultSearchCapabilities);
@@ -28,5 +28,5 @@ export const registerRollupSearchStrategy = (kbnServer, server) =>
RollupSearchCapabilities
);
- addSearchStrategy(new RollupSearchStrategy(server));
+ addSearchStrategy(new RollupSearchStrategy(kbnServer));
});
diff --git a/x-pack/legacy/plugins/rollup/server/lib/search_strategies/register_rollup_search_strategy.test.js b/x-pack/legacy/plugins/rollup/server/lib/search_strategies/register_rollup_search_strategy.test.js
index 5a1e4f27b1453c..acd016d75f97ed 100644
--- a/x-pack/legacy/plugins/rollup/server/lib/search_strategies/register_rollup_search_strategy.test.js
+++ b/x-pack/legacy/plugins/rollup/server/lib/search_strategies/register_rollup_search_strategy.test.js
@@ -14,6 +14,9 @@ describe('Register Rollup Search Strategy', () => {
kbnServer = {
afterPluginsInit,
+ newPlatform: {
+ setup: { plugins: {} },
+ },
};
metrics = {
@@ -25,27 +28,22 @@ describe('Register Rollup Search Strategy', () => {
});
test('should run initialization on "afterPluginsInit" hook', () => {
- registerRollupSearchStrategy(kbnServer, {
- plugins: {},
- });
+ registerRollupSearchStrategy(kbnServer);
expect(kbnServer.afterPluginsInit).toHaveBeenCalled();
});
test('should run initialization if metrics plugin available', () => {
- registerRollupSearchStrategy(kbnServer, {
- plugins: {
- metrics,
- },
+ registerRollupSearchStrategy({
+ ...kbnServer,
+ newPlatform: { setup: { plugins: { metrics } } },
});
expect(metrics.addSearchStrategy).toHaveBeenCalled();
});
test('should not run initialization if metrics plugin unavailable', () => {
- registerRollupSearchStrategy(kbnServer, {
- plugins: {},
- });
+ registerRollupSearchStrategy(kbnServer);
expect(metrics.addSearchStrategy).not.toHaveBeenCalled();
});
From ef8dba30498b347179b695d17a760a2b0087b27c Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Thu, 30 Jan 2020 17:07:45 +0100
Subject: [PATCH 17/69] [ML] conditional rison encoding for query params
(#56380)
---
.../public/application/util/url_state.test.ts | 2 +-
.../ml/public/application/util/url_state.ts | 22 ++++++++++++++++---
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/x-pack/legacy/plugins/ml/public/application/util/url_state.test.ts b/x-pack/legacy/plugins/ml/public/application/util/url_state.test.ts
index 91bbef2dba6c2b..0813f2e3da97fd 100644
--- a/x-pack/legacy/plugins/ml/public/application/util/url_state.test.ts
+++ b/x-pack/legacy/plugins/ml/public/application/util/url_state.test.ts
@@ -75,7 +75,7 @@ describe('useUrlState', () => {
expect(mockHistoryPush).toHaveBeenCalledWith({
search:
- '_a=%28mlExplorerFilter%3A%28%29%2CmlExplorerSwimlane%3A%28viewByFieldName%3Aaction%29%2Cquery%3A%28%29%29&_g=%28ml%3A%28jobIds%3A%21%28dec-2%29%29%2CrefreshInterval%3A%28display%3AOff%2Cpause%3A%21f%2Cvalue%3A0%29%2Ctime%3A%28from%3A%272019-01-01T00%3A03%3A40.000Z%27%2Cmode%3Aabsolute%2Cto%3A%272019-08-30T11%3A55%3A07.000Z%27%29%29&savedSearchId=%27571aaf70-4c88-11e8-b3d7-01146121b73d%27',
+ '_a=%28mlExplorerFilter%3A%28%29%2CmlExplorerSwimlane%3A%28viewByFieldName%3Aaction%29%2Cquery%3A%28%29%29&_g=%28ml%3A%28jobIds%3A%21%28dec-2%29%29%2CrefreshInterval%3A%28display%3AOff%2Cpause%3A%21f%2Cvalue%3A0%29%2Ctime%3A%28from%3A%272019-01-01T00%3A03%3A40.000Z%27%2Cmode%3Aabsolute%2Cto%3A%272019-08-30T11%3A55%3A07.000Z%27%29%29&savedSearchId=571aaf70-4c88-11e8-b3d7-01146121b73d',
});
});
});
diff --git a/x-pack/legacy/plugins/ml/public/application/util/url_state.ts b/x-pack/legacy/plugins/ml/public/application/util/url_state.ts
index 546944b1a33bff..e7d5a94e2694fb 100644
--- a/x-pack/legacy/plugins/ml/public/application/util/url_state.ts
+++ b/x-pack/legacy/plugins/ml/public/application/util/url_state.ts
@@ -18,14 +18,26 @@ import { getNestedProperty } from './object_utils';
export type SetUrlState = (attribute: string | Dictionary, value?: any) => void;
export type UrlState = [Dictionary, SetUrlState];
-const decodedParams = new Set(['_a', '_g']);
+/**
+ * Set of URL query parameters that require the rison serialization.
+ */
+const risonSerializedParams = new Set(['_a', '_g']);
+
+/**
+ * Checks if the URL query parameter requires rison serialization.
+ * @param queryParam
+ */
+function isRisonSerializationRequired(queryParam: string): boolean {
+ return risonSerializedParams.has(queryParam);
+}
+
export function getUrlState(search: string): Dictionary {
const urlState: Dictionary = {};
const parsedQueryString = queryString.parse(search);
try {
Object.keys(parsedQueryString).forEach(a => {
- if (decodedParams.has(a)) {
+ if (isRisonSerializationRequired(a)) {
urlState[a] = decode(parsedQueryString[a]) as Dictionary;
} else {
urlState[a] = parsedQueryString[a];
@@ -75,7 +87,11 @@ export const useUrlState = (accessor: string): UrlState => {
const oldLocationSearch = queryString.stringify(parsedQueryString, { encode: false });
Object.keys(urlState).forEach(a => {
- parsedQueryString[a] = encode(urlState[a]);
+ if (isRisonSerializationRequired(a)) {
+ parsedQueryString[a] = encode(urlState[a]);
+ } else {
+ parsedQueryString[a] = urlState[a];
+ }
});
const newLocationSearch = queryString.stringify(parsedQueryString, { encode: false });
From c28f7bacdad6f4ea2ecacc6fa48e03ae6493ae1e Mon Sep 17 00:00:00 2001
From: Chris Roberson
Date: Thu, 30 Jan 2020 11:13:14 -0500
Subject: [PATCH 18/69] [Monitoring] Change all configs to `monitoring.*`
(#56215)
* Revert "Revert "[Monitoring] Change all configs to `monitoring.*`" (#56214)"
This reverts commit bd08eb7efcd0df87581d91b6c69e270f4fe5670d.
* Fix missing config changes
* More fixes
* Doc changes
Co-authored-by: Elastic Machine
---
docs/settings/monitoring-settings.asciidoc | 32 +++----
.../config/deprecation/core_deprecations.ts | 50 ++++++++++
x-pack/legacy/plugins/monitoring/config.js | 96 +++++++++----------
.../legacy/plugins/monitoring/deprecations.js | 4 +-
x-pack/legacy/plugins/monitoring/index.js | 34 +++----
.../flyout/__snapshots__/flyout.test.js.snap | 8 +-
...isable_internal_collection_instructions.js | 4 +-
.../cluster_alerts/alerts_cluster_search.js | 2 +-
.../verify_monitoring_license.js | 2 +-
.../es_client/__tests__/instantiate_client.js | 6 +-
.../parse_elasticsearch_config.test.ts | 4 +-
.../es_client/parse_elasticsearch_config.ts | 2 +-
.../server/init_monitoring_xpack_info.js | 2 +-
.../server/kibana_monitoring/bulk_uploader.js | 2 +-
.../__tests__/get_default_admin_email.js | 12 +--
.../collectors/get_settings_collector.js | 4 +-
.../collectors/ops_buffer/ops_buffer.js | 2 +-
.../server/kibana_monitoring/init.js | 2 +-
.../server/lib/__tests__/ccs_utils.js | 8 +-
.../monitoring/server/lib/apm/get_apms.js | 2 +-
.../server/lib/apm/get_apms_for_clusters.js | 2 +-
.../monitoring/server/lib/apm/get_stats.js | 2 +-
.../monitoring/server/lib/beats/get_beats.js | 2 +-
.../lib/beats/get_beats_for_clusters.js | 2 +-
.../server/lib/beats/get_latest_stats.js | 2 +-
.../monitoring/server/lib/beats/get_stats.js | 2 +-
.../monitoring/server/lib/ccs_utils.js | 2 +-
.../lib/cluster/get_clusters_from_request.js | 2 +-
.../server/lib/cluster/get_clusters_stats.js | 2 +-
.../lib/details/__test__/get_metrics.test.js | 2 +-
.../server/lib/details/get_metrics.js | 2 +-
.../server/lib/elasticsearch/get_ml_jobs.js | 2 +-
.../lib/elasticsearch/indices/get_indices.js | 2 +-
.../nodes/get_nodes/get_nodes.js | 6 +-
.../nodes/get_nodes/get_paginated_nodes.js | 4 +-
.../get_indices_unassigned_shard_stats.js | 2 +-
.../shards/get_nodes_shard_count.js | 2 +-
.../shards/get_shard_allocation.js | 2 +-
.../shards/get_shard_stat_aggs.js | 2 +-
.../server/lib/kibana/get_kibanas.js | 2 +-
.../lib/kibana/get_kibanas_for_clusters.js | 2 +-
.../monitoring/server/lib/logs/get_logs.js | 2 +-
.../lib/logstash/get_logstash_for_clusters.js | 6 +-
.../server/lib/logstash/get_nodes.js | 2 +-
.../lib/logstash/get_paginated_pipelines.js | 2 +-
.../server/lib/logstash/get_pipeline.js | 2 +-
.../get_pipeline_stats_aggregation.js | 2 +-
.../lib/logstash/get_pipeline_versions.js | 2 +-
.../lib/logstash/get_pipeline_vertex.js | 2 +-
.../get_pipeline_vertex_stats_aggregation.js | 2 +-
.../plugins/monitoring/server/plugin.js | 16 ++--
.../server/routes/api/v1/elasticsearch/ccr.js | 2 +-
.../api/v1/elasticsearch/node_detail.js | 2 +-
.../server/routes/api/v1/logstash/node.js | 4 +-
.../pipelines/cluster_pipeline_ids.js | 2 +-
.../telemetry_collection/get_cluster_uuids.ts | 2 +-
.../telemetry_collection/get_es_stats.js | 2 +-
.../get_high_level_stats.js | 2 +-
.../legacy/plugins/monitoring/ui_exports.js | 2 +-
59 files changed, 212 insertions(+), 170 deletions(-)
diff --git a/docs/settings/monitoring-settings.asciidoc b/docs/settings/monitoring-settings.asciidoc
index 8f445ff25218bc..8586d26e9a07ad 100644
--- a/docs/settings/monitoring-settings.asciidoc
+++ b/docs/settings/monitoring-settings.asciidoc
@@ -14,7 +14,7 @@ built-in `elastic` user has this role.
You can adjust how monitoring data is
collected from {kib} and displayed in {kib} by configuring settings in the
-`kibana.yml` file. There are also `xpack.monitoring.elasticsearch.*` settings,
+`kibana.yml` file. There are also `monitoring.ui.elasticsearch.*` settings,
which support the same values as <>.
To control how data is collected from your {es} nodes, you configure
@@ -31,20 +31,20 @@ For more information, see
[[monitoring-general-settings]]
==== General monitoring settings
-`xpack.monitoring.enabled`::
+`monitoring.enabled`::
Set to `true` (default) to enable the {monitor-features} in {kib}. Unlike the
-`xpack.monitoring.ui.enabled` setting, when this setting is `false`, the
+`monitoring.ui.enabled` setting, when this setting is `false`, the
monitoring back-end does not run and {kib} stats are not sent to the monitoring
cluster.
-`xpack.monitoring.elasticsearch.hosts`::
+`monitoring.ui.elasticsearch.hosts`::
Specifies the location of the {es} cluster where your monitoring data is stored.
By default, this is the same as `elasticsearch.hosts`. This setting enables
you to use a single {kib} instance to search and visualize data in your
production cluster as well as monitor data sent to a dedicated monitoring
cluster.
-`xpack.monitoring.elasticsearch.username`::
+`monitoring.ui.elasticsearch.username`::
Specifies the username used by {kib} monitoring to establish a persistent connection
in {kib} to the {es} monitoring cluster and to verify licensing status on the {es}
monitoring cluster.
@@ -55,7 +55,7 @@ both the {es} monitoring cluster and the {es} production cluster.
If not set, {kib} uses the value of the `elasticsearch.username` setting.
-`xpack.monitoring.elasticsearch.password`::
+`monitoring.ui.elasticsearch.password`::
Specifies the password used by {kib} monitoring to establish a persistent connection
in {kib} to the {es} monitoring cluster and to verify licensing status on the {es}
monitoring cluster.
@@ -66,7 +66,7 @@ both the {es} monitoring cluster and the {es} production cluster.
If not set, {kib} uses the value of the `elasticsearch.password` setting.
-`xpack.monitoring.elasticsearch.pingTimeout`::
+`monitoring.ui.elasticsearch.pingTimeout`::
Specifies the time in milliseconds to wait for {es} to respond to internal
health checks. By default, it matches the `elasticsearch.pingTimeout` setting,
which has a default value of `30000`.
@@ -77,11 +77,11 @@ which has a default value of `30000`.
These settings control how data is collected from {kib}.
-`xpack.monitoring.kibana.collection.enabled`::
+`monitoring.kibana.collection.enabled`::
Set to `true` (default) to enable data collection from the {kib} NodeJS server
for {kib} Dashboards to be featured in the Monitoring.
-`xpack.monitoring.kibana.collection.interval`::
+`monitoring.kibana.collection.interval`::
Specifies the number of milliseconds to wait in between data sampling on the
{kib} NodeJS server for the metrics that are displayed in the {kib} dashboards.
Defaults to `10000` (10 seconds).
@@ -96,24 +96,24 @@ However, the defaults work best in most circumstances. For more information
about configuring {kib}, see
{kibana-ref}/settings.html[Setting Kibana Server Properties].
-`xpack.monitoring.elasticsearch.logFetchCount`::
+`monitoring.ui.elasticsearch.logFetchCount`::
Specifies the number of log entries to display in the Monitoring UI. Defaults to
`10`. The maximum value is `50`.
-`xpack.monitoring.max_bucket_size`::
+`monitoring.ui.max_bucket_size`::
Specifies the number of term buckets to return out of the overall terms list when
performing terms aggregations to retrieve index and node metrics. For more
information about the `size` parameter, see
{ref}/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-size[Terms Aggregation].
Defaults to `10000`.
-`xpack.monitoring.min_interval_seconds`::
+`monitoring.ui.min_interval_seconds`::
Specifies the minimum number of seconds that a time bucket in a chart can
represent. Defaults to 10. If you modify the
-`xpack.monitoring.collection.interval` in `elasticsearch.yml`, use the same
+`monitoring.ui.collection.interval` in `elasticsearch.yml`, use the same
value in this setting.
-`xpack.monitoring.ui.enabled`::
+`monitoring.ui.enabled`::
Set to `false` to hide the Monitoring UI in {kib}. The monitoring back-end
continues to run as an agent for sending {kib} stats to the monitoring
cluster. Defaults to `true`.
@@ -127,7 +127,7 @@ better decisions about your container performance, rather than guessing based on
the overall machine performance. If you are not running your applications in a
container, then Cgroup statistics are not useful.
-`xpack.monitoring.ui.container.elasticsearch.enabled`::
+`monitoring.ui.container.elasticsearch.enabled`::
For {es} clusters that are running in containers, this setting changes the
*Node Listing* to display the CPU utilization based on the reported Cgroup
@@ -135,7 +135,7 @@ statistics. It also adds the calculated Cgroup CPU utilization to the
*Node Overview* page instead of the overall operating system's CPU
utilization. Defaults to `false`.
-`xpack.monitoring.ui.container.logstash.enabled`::
+`monitoring.ui.container.logstash.enabled`::
For {ls} nodes that are running in containers, this setting
changes the {ls} *Node Listing* to display the CPU utilization
diff --git a/src/core/server/config/deprecation/core_deprecations.ts b/src/core/server/config/deprecation/core_deprecations.ts
index c63c9384da9d83..3aa7f9e2aa8ad2 100644
--- a/src/core/server/config/deprecation/core_deprecations.ts
+++ b/src/core/server/config/deprecation/core_deprecations.ts
@@ -119,6 +119,56 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({
renameFromRoot('xpack.telemetry.config', 'telemetry.config'),
renameFromRoot('xpack.telemetry.banner', 'telemetry.banner'),
renameFromRoot('xpack.telemetry.url', 'telemetry.url'),
+ // Monitoring renames
+ // TODO: Remove these from here once the monitoring plugin is migrated to NP
+ renameFromRoot('xpack.monitoring.enabled', 'monitoring.enabled'),
+ renameFromRoot('xpack.monitoring.ui.enabled', 'monitoring.ui.enabled'),
+ renameFromRoot(
+ 'xpack.monitoring.kibana.collection.enabled',
+ 'monitoring.kibana.collection.enabled'
+ ),
+ renameFromRoot('xpack.monitoring.max_bucket_size', 'monitoring.ui.max_bucket_size'),
+ renameFromRoot('xpack.monitoring.min_interval_seconds', 'monitoring.ui.min_interval_seconds'),
+ renameFromRoot(
+ 'xpack.monitoring.show_license_expiration',
+ 'monitoring.ui.show_license_expiration'
+ ),
+ renameFromRoot(
+ 'xpack.monitoring.ui.container.elasticsearch.enabled',
+ 'monitoring.ui.container.elasticsearch.enabled'
+ ),
+ renameFromRoot(
+ 'xpack.monitoring.ui.container.logstash.enabled',
+ 'monitoring.ui.container.logstash.enabled'
+ ),
+ renameFromRoot(
+ 'xpack.monitoring.tests.cloud_detector.enabled',
+ 'monitoring.tests.cloud_detector.enabled'
+ ),
+ renameFromRoot(
+ 'xpack.monitoring.kibana.collection.interval',
+ 'monitoring.kibana.collection.interval'
+ ),
+ renameFromRoot('xpack.monitoring.elasticsearch.hosts', 'monitoring.ui.elasticsearch.hosts'),
+ renameFromRoot('xpack.monitoring.elasticsearch.username', 'monitoring.ui.elasticsearch.username'),
+ renameFromRoot('xpack.monitoring.elasticsearch.password', 'monitoring.ui.elasticsearch.password'),
+ renameFromRoot(
+ 'xpack.monitoring.xpack_api_polling_frequency_millis',
+ 'monitoring.xpack_api_polling_frequency_millis'
+ ),
+ renameFromRoot(
+ 'xpack.monitoring.cluster_alerts.email_notifications.enabled',
+ 'monitoring.cluster_alerts.email_notifications.enabled'
+ ),
+ renameFromRoot(
+ 'xpack.monitoring.cluster_alerts.email_notifications.email_address',
+ 'monitoring.cluster_alerts.email_notifications.email_address'
+ ),
+ renameFromRoot('xpack.monitoring.ccs.enabled', 'monitoring.ui.ccs.enabled'),
+ renameFromRoot(
+ 'xpack.monitoring.elasticsearch.logFetchCount',
+ 'monitoring.ui.elasticsearch.logFetchCount'
+ ),
configPathDeprecation,
dataPathDeprecation,
rewriteBasePathDeprecation,
diff --git a/x-pack/legacy/plugins/monitoring/config.js b/x-pack/legacy/plugins/monitoring/config.js
index 91c1ee99a0b2e4..778b656c056f20 100644
--- a/x-pack/legacy/plugins/monitoring/config.js
+++ b/x-pack/legacy/plugins/monitoring/config.js
@@ -15,12 +15,12 @@ export const config = Joi => {
const DEFAULT_REQUEST_HEADERS = ['authorization'];
return Joi.object({
- ccs: Joi.object({
- enabled: Joi.boolean().default(true),
- }).default(),
enabled: Joi.boolean().default(true),
ui: Joi.object({
enabled: Joi.boolean().default(true),
+ ccs: Joi.object({
+ enabled: Joi.boolean().default(true),
+ }).default(),
container: Joi.object({
elasticsearch: Joi.object({
enabled: Joi.boolean().default(false),
@@ -29,6 +29,51 @@ export const config = Joi => {
enabled: Joi.boolean().default(false),
}).default(),
}).default(),
+ max_bucket_size: Joi.number().default(10000),
+ min_interval_seconds: Joi.number().default(10),
+ show_license_expiration: Joi.boolean().default(true),
+ elasticsearch: Joi.object({
+ customHeaders: Joi.object().default({}),
+ logQueries: Joi.boolean().default(false),
+ requestHeadersWhitelist: Joi.array()
+ .items()
+ .single()
+ .default(DEFAULT_REQUEST_HEADERS),
+ sniffOnStart: Joi.boolean().default(false),
+ sniffInterval: Joi.number()
+ .allow(false)
+ .default(false),
+ sniffOnConnectionFault: Joi.boolean().default(false),
+ hosts: Joi.array()
+ .items(Joi.string().uri({ scheme: ['http', 'https'] }))
+ .single(), // if empty, use Kibana's connection config
+ username: Joi.string(),
+ password: Joi.string(),
+ requestTimeout: Joi.number().default(30000),
+ pingTimeout: Joi.number().default(30000),
+ ssl: Joi.object({
+ verificationMode: Joi.string()
+ .valid('none', 'certificate', 'full')
+ .default('full'),
+ certificateAuthorities: Joi.array()
+ .single()
+ .items(Joi.string()),
+ certificate: Joi.string(),
+ key: Joi.string(),
+ keyPassphrase: Joi.string(),
+ keystore: Joi.object({
+ path: Joi.string(),
+ password: Joi.string(),
+ }).default(),
+ truststore: Joi.object({
+ path: Joi.string(),
+ password: Joi.string(),
+ }).default(),
+ alwaysPresentCertificate: Joi.boolean().default(false),
+ }).default(),
+ apiVersion: Joi.string().default('master'),
+ logFetchCount: Joi.number().default(10),
+ }).default(),
}).default(),
kibana: Joi.object({
collection: Joi.object({
@@ -46,56 +91,11 @@ export const config = Joi => {
xpack_api_polling_frequency_millis: Joi.number().default(
XPACK_INFO_API_DEFAULT_POLL_FREQUENCY_IN_MILLIS
),
- max_bucket_size: Joi.number().default(10000),
- min_interval_seconds: Joi.number().default(10),
- show_license_expiration: Joi.boolean().default(true),
agent: Joi.object({
interval: Joi.string()
.regex(/[\d\.]+[yMwdhms]/)
.default('10s'),
}).default(),
- elasticsearch: Joi.object({
- customHeaders: Joi.object().default({}),
- logQueries: Joi.boolean().default(false),
- requestHeadersWhitelist: Joi.array()
- .items()
- .single()
- .default(DEFAULT_REQUEST_HEADERS),
- sniffOnStart: Joi.boolean().default(false),
- sniffInterval: Joi.number()
- .allow(false)
- .default(false),
- sniffOnConnectionFault: Joi.boolean().default(false),
- hosts: Joi.array()
- .items(Joi.string().uri({ scheme: ['http', 'https'] }))
- .single(), // if empty, use Kibana's connection config
- username: Joi.string(),
- password: Joi.string(),
- requestTimeout: Joi.number().default(30000),
- pingTimeout: Joi.number().default(30000),
- ssl: Joi.object({
- verificationMode: Joi.string()
- .valid('none', 'certificate', 'full')
- .default('full'),
- certificateAuthorities: Joi.array()
- .single()
- .items(Joi.string()),
- certificate: Joi.string(),
- key: Joi.string(),
- keyPassphrase: Joi.string(),
- keystore: Joi.object({
- path: Joi.string(),
- password: Joi.string(),
- }).default(),
- truststore: Joi.object({
- path: Joi.string(),
- password: Joi.string(),
- }).default(),
- alwaysPresentCertificate: Joi.boolean().default(false),
- }).default(),
- apiVersion: Joi.string().default('master'),
- logFetchCount: Joi.number().default(10),
- }).default(),
tests: Joi.object({
cloud_detector: Joi.object({
enabled: Joi.boolean().default(true),
diff --git a/x-pack/legacy/plugins/monitoring/deprecations.js b/x-pack/legacy/plugins/monitoring/deprecations.js
index c3b2b70690f33b..6e35e86dd9d718 100644
--- a/x-pack/legacy/plugins/monitoring/deprecations.js
+++ b/x-pack/legacy/plugins/monitoring/deprecations.js
@@ -28,7 +28,7 @@ export const deprecations = () => {
}
},
(settings, log) => {
- const fromPath = 'xpack.monitoring.elasticsearch';
+ const fromPath = 'monitoring.elasticsearch';
const es = get(settings, 'elasticsearch');
if (es) {
if (es.username === 'elastic') {
@@ -39,7 +39,7 @@ export const deprecations = () => {
}
},
(settings, log) => {
- const fromPath = 'xpack.monitoring.elasticsearch.ssl';
+ const fromPath = 'monitoring.elasticsearch.ssl';
const ssl = get(settings, 'elasticsearch.ssl');
if (ssl) {
if (ssl.key !== undefined && ssl.certificate === undefined) {
diff --git a/x-pack/legacy/plugins/monitoring/index.js b/x-pack/legacy/plugins/monitoring/index.js
index 8e0201bea710bc..ca595836133c2c 100644
--- a/x-pack/legacy/plugins/monitoring/index.js
+++ b/x-pack/legacy/plugins/monitoring/index.js
@@ -20,31 +20,31 @@ export const monitoring = kibana =>
new kibana.Plugin({
require: ['kibana', 'elasticsearch', 'xpack_main'],
id: 'monitoring',
- configPrefix: 'xpack.monitoring',
+ configPrefix: 'monitoring',
publicDir: resolve(__dirname, 'public'),
init(server) {
const configs = [
- 'xpack.monitoring.ui.enabled',
- 'xpack.monitoring.kibana.collection.enabled',
- 'xpack.monitoring.max_bucket_size',
- 'xpack.monitoring.min_interval_seconds',
+ 'monitoring.ui.enabled',
+ 'monitoring.kibana.collection.enabled',
+ 'monitoring.ui.max_bucket_size',
+ 'monitoring.ui.min_interval_seconds',
'kibana.index',
- 'xpack.monitoring.show_license_expiration',
- 'xpack.monitoring.ui.container.elasticsearch.enabled',
- 'xpack.monitoring.ui.container.logstash.enabled',
- 'xpack.monitoring.tests.cloud_detector.enabled',
- 'xpack.monitoring.kibana.collection.interval',
- 'xpack.monitoring.elasticsearch.hosts',
- 'xpack.monitoring.elasticsearch',
- 'xpack.monitoring.xpack_api_polling_frequency_millis',
+ 'monitoring.ui.show_license_expiration',
+ 'monitoring.ui.container.elasticsearch.enabled',
+ 'monitoring.ui.container.logstash.enabled',
+ 'monitoring.tests.cloud_detector.enabled',
+ 'monitoring.kibana.collection.interval',
+ 'monitoring.ui.elasticsearch.hosts',
+ 'monitoring.ui.elasticsearch',
+ 'monitoring.xpack_api_polling_frequency_millis',
'server.uuid',
'server.name',
'server.host',
'server.port',
- 'xpack.monitoring.cluster_alerts.email_notifications.enabled',
- 'xpack.monitoring.cluster_alerts.email_notifications.email_address',
- 'xpack.monitoring.ccs.enabled',
- 'xpack.monitoring.elasticsearch.logFetchCount',
+ 'monitoring.cluster_alerts.email_notifications.enabled',
+ 'monitoring.cluster_alerts.email_notifications.email_address',
+ 'monitoring.ui.ccs.enabled',
+ 'monitoring.ui.elasticsearch.logFetchCount',
];
const serverConfig = server.config();
diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
index 7f48f3386b1807..eb1c65c6a696da 100644
--- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
+++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap
@@ -1174,7 +1174,7 @@ exports[`Flyout kibana part two should show instructions to disable internal col
isCopyable={true}
language="bash"
>
- xpack.monitoring.kibana.collection.enabled: false
+ monitoring.kibana.collection.enabled: false
- xpack.monitoring.enabled
+ monitoring.enabled
,
"defaultValue":
true
@@ -2091,7 +2091,7 @@ exports[`Flyout should show a restart warning for restarting the primary Kibana
isCopyable={true}
language="bash"
>
- xpack.monitoring.kibana.collection.enabled: false
+ monitoring.kibana.collection.enabled: false
- xpack.monitoring.enabled
+ monitoring.enabled
,
"defaultValue":
true
diff --git a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js
index 9326156c1ac36e..5f7f97b74e8717 100644
--- a/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js
+++ b/x-pack/legacy/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js
@@ -61,7 +61,7 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met
- xpack.monitoring.kibana.collection.enabled: false
+ monitoring.kibana.collection.enabled: false
@@ -70,7 +70,7 @@ export function getKibanaInstructionsForDisablingInternalCollection(product, met
id="xpack.monitoring.metricbeatMigration.kibanaInstructions.disableInternalCollection.note"
defaultMessage="For {config}, leave the default value of ({defaultValue})."
values={{
- config: xpack.monitoring.enabled,
+ config: monitoring.enabled,
defaultValue: true,
}}
/>
diff --git a/x-pack/legacy/plugins/monitoring/server/cluster_alerts/alerts_cluster_search.js b/x-pack/legacy/plugins/monitoring/server/cluster_alerts/alerts_cluster_search.js
index 0c9fb4bd04ee77..eff9875d794adf 100644
--- a/x-pack/legacy/plugins/monitoring/server/cluster_alerts/alerts_cluster_search.js
+++ b/x-pack/legacy/plugins/monitoring/server/cluster_alerts/alerts_cluster_search.js
@@ -157,7 +157,7 @@ export function alertsClusterSearch(req, alertsIndex, cluster, checkLicense, opt
if (prodLicenseInfo.clusterAlerts.enabled) {
const config = req.server.config();
- const size = options.size || config.get('xpack.monitoring.max_bucket_size');
+ const size = options.size || config.get('monitoring.ui.max_bucket_size');
const params = {
index: alertsIndex,
diff --git a/x-pack/legacy/plugins/monitoring/server/cluster_alerts/verify_monitoring_license.js b/x-pack/legacy/plugins/monitoring/server/cluster_alerts/verify_monitoring_license.js
index 9cc67e11c28d57..e94f4e08fbdb18 100644
--- a/x-pack/legacy/plugins/monitoring/server/cluster_alerts/verify_monitoring_license.js
+++ b/x-pack/legacy/plugins/monitoring/server/cluster_alerts/verify_monitoring_license.js
@@ -19,7 +19,7 @@ export function verifyMonitoringLicense(server) {
const config = server.config();
// if cluster alerts are enabled, then ensure that we can use it according to the license
- if (config.get('xpack.monitoring.cluster_alerts.enabled')) {
+ if (config.get('monitoring.cluster_alerts.enabled')) {
const xpackInfo = get(server.plugins.monitoring, 'info');
if (xpackInfo) {
const monitoringCluster = xpackInfo.feature('monitoring').getLicenseCheckResults();
diff --git a/x-pack/legacy/plugins/monitoring/server/es_client/__tests__/instantiate_client.js b/x-pack/legacy/plugins/monitoring/server/es_client/__tests__/instantiate_client.js
index 6844bd5febf8ee..88cf9734d5f57d 100644
--- a/x-pack/legacy/plugins/monitoring/server/es_client/__tests__/instantiate_client.js
+++ b/x-pack/legacy/plugins/monitoring/server/es_client/__tests__/instantiate_client.js
@@ -11,8 +11,8 @@ import { exposeClient, hasMonitoringCluster } from '../instantiate_client';
function getMockServerFromConnectionUrl(monitoringClusterUrl) {
const server = {
- xpack: {
- monitoring: {
+ monitoring: {
+ ui: {
elasticsearch: {
hosts: monitoringClusterUrl ? [monitoringClusterUrl] : [],
username: 'monitoring-user-internal-test',
@@ -27,7 +27,7 @@ function getMockServerFromConnectionUrl(monitoringClusterUrl) {
};
return {
- elasticsearchConfig: server.xpack.monitoring.elasticsearch,
+ elasticsearchConfig: server.monitoring.ui.elasticsearch,
elasticsearchPlugin: {
getCluster: sinon
.stub()
diff --git a/x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.test.ts b/x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.test.ts
index c6f4e0fa685045..8d9b5335732c0c 100644
--- a/x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.test.ts
+++ b/x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.test.ts
@@ -168,14 +168,14 @@ describe('throws when config is invalid', () => {
it('throws if key and keystore.path are both specified', () => {
const value = { ssl: { key: 'foo', keystore: { path: 'bar' } } };
expect(() => parse(value)).toThrowErrorMatchingInlineSnapshot(
- `"[config validation of [xpack.monitoring.elasticsearch].ssl]: cannot use [key] when [keystore.path] is specified"`
+ `"[config validation of [monitoring.ui.elasticsearch].ssl]: cannot use [key] when [keystore.path] is specified"`
);
});
it('throws if certificate and keystore.path are both specified', () => {
const value = { ssl: { certificate: 'foo', keystore: { path: 'bar' } } };
expect(() => parse(value)).toThrowErrorMatchingInlineSnapshot(
- `"[config validation of [xpack.monitoring.elasticsearch].ssl]: cannot use [certificate] when [keystore.path] is specified"`
+ `"[config validation of [monitoring.ui.elasticsearch].ssl]: cannot use [certificate] when [keystore.path] is specified"`
);
});
});
diff --git a/x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.ts b/x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.ts
index 70e6235602b5b9..728b3433bf06c0 100644
--- a/x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.ts
+++ b/x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.ts
@@ -7,7 +7,7 @@
import { readFileSync } from 'fs';
import { readPkcs12Truststore, readPkcs12Keystore } from '../../../../../../src/core/utils';
-const KEY = 'xpack.monitoring.elasticsearch';
+const KEY = 'monitoring.ui.elasticsearch';
/*
* Parse a config object's Elasticsearch configuration, reading any
diff --git a/x-pack/legacy/plugins/monitoring/server/init_monitoring_xpack_info.js b/x-pack/legacy/plugins/monitoring/server/init_monitoring_xpack_info.js
index b43430ead23b0f..ba07f512de896a 100644
--- a/x-pack/legacy/plugins/monitoring/server/init_monitoring_xpack_info.js
+++ b/x-pack/legacy/plugins/monitoring/server/init_monitoring_xpack_info.js
@@ -15,7 +15,7 @@ export const initMonitoringXpackInfo = async ({ config, xpackMainPlugin, expose,
const xpackInfo = hasMonitoringCluster(config)
? xpackMainPlugin.createXPackInfo({
clusterSource: 'monitoring',
- pollFrequencyInMillis: config.get('xpack.monitoring.xpack_api_polling_frequency_millis'),
+ pollFrequencyInMillis: config.get('monitoring.xpack_api_polling_frequency_millis'),
})
: xpackMainPlugin.info;
diff --git a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/bulk_uploader.js b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/bulk_uploader.js
index 5e0d8aa4be1fdc..cf68ec073bebc8 100644
--- a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/bulk_uploader.js
+++ b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/bulk_uploader.js
@@ -24,7 +24,7 @@ const LOGGING_TAGS = [LOGGING_TAG, KIBANA_MONITORING_LOGGING_TAG];
* NOTE: internal collection will be removed in 7.0
*
* Depends on
- * - 'xpack.monitoring.kibana.collection.enabled' config
+ * - 'monitoring.kibana.collection.enabled' config
* - monitoring enabled in ES (checked against xpack_main.info license info change)
* The dependencies are handled upstream
* - Ops Events - essentially Kibana's /api/status
diff --git a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/get_default_admin_email.js b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/get_default_admin_email.js
index 96dc461c03fd30..10f52a82a830cf 100644
--- a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/get_default_admin_email.js
+++ b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/__tests__/get_default_admin_email.js
@@ -14,14 +14,10 @@ describe('getSettingsCollector / getDefaultAdminEmail', () => {
function setup({ enabled = true, adminEmail = null } = {}) {
const config = { get: sinon.stub() };
- config.get
- .withArgs('xpack.monitoring.cluster_alerts.email_notifications.enabled')
- .returns(enabled);
+ config.get.withArgs('monitoring.cluster_alerts.email_notifications.enabled').returns(enabled);
if (adminEmail) {
- config.get
- .withArgs(`xpack.monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`)
- .returns(adminEmail);
+ config.get.withArgs(`monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`).returns(adminEmail);
}
config.get.withArgs('kibana.index').returns('.kibana');
@@ -31,7 +27,7 @@ describe('getSettingsCollector / getDefaultAdminEmail', () => {
return config;
}
- describe('xpack.monitoring.cluster_alerts.email_notifications.enabled = false', () => {
+ describe('monitoring.cluster_alerts.email_notifications.enabled = false', () => {
it('returns null when email is defined', async () => {
const config = setup({ enabled: false });
expect(await getDefaultAdminEmail(config)).to.be(null);
@@ -43,7 +39,7 @@ describe('getSettingsCollector / getDefaultAdminEmail', () => {
});
});
- describe('xpack.monitoring.cluster_alerts.email_notifications.enabled = true', () => {
+ describe('monitoring.cluster_alerts.email_notifications.enabled = true', () => {
it('returns value when email is defined', async () => {
const config = setup({ adminEmail: 'hello@world' });
expect(await getDefaultAdminEmail(config)).to.be('hello@world');
diff --git a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.js b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.js
index d0e1d32a2baa4c..f51e7d22a0c7cf 100644
--- a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.js
+++ b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.js
@@ -11,11 +11,11 @@ import { CLUSTER_ALERTS_ADDRESS_CONFIG_KEY, KIBANA_SETTINGS_TYPE } from '../../.
* If so, get email from kibana.yml
*/
export async function getDefaultAdminEmail(config) {
- if (!config.get('xpack.monitoring.cluster_alerts.email_notifications.enabled')) {
+ if (!config.get('monitoring.cluster_alerts.email_notifications.enabled')) {
return null;
}
- const emailAddressConfigKey = `xpack.monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`;
+ const emailAddressConfigKey = `monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`;
const configuredEmailAddress = config.get(emailAddressConfigKey);
return configuredEmailAddress || null;
diff --git a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/ops_buffer.js b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/ops_buffer.js
index d58f6f3254c762..699a364433b3e8 100644
--- a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/ops_buffer.js
+++ b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/ops_buffer/ops_buffer.js
@@ -17,7 +17,7 @@ export function opsBuffer({ config, log, getOSInfo }) {
// determine the cloud service in the background
const cloudDetector = new CloudDetector();
- if (config.get('xpack.monitoring.tests.cloud_detector.enabled')) {
+ if (config.get('monitoring.tests.cloud_detector.enabled')) {
cloudDetector.detectCloudService();
}
diff --git a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/init.js b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/init.js
index bf79ddc2109029..3c02e2be58dec3 100644
--- a/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/init.js
+++ b/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/init.js
@@ -16,7 +16,7 @@ import { BulkUploader } from './bulk_uploader';
* @param {Object} server HapiJS server instance
*/
export function initBulkUploader({ config, ...params }) {
- const interval = config.get('xpack.monitoring.kibana.collection.interval');
+ const interval = config.get('monitoring.kibana.collection.interval');
return new BulkUploader({
interval,
config,
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/__tests__/ccs_utils.js b/x-pack/legacy/plugins/monitoring/server/lib/__tests__/ccs_utils.js
index 844dfc96bb19b9..2d310962238fd4 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/__tests__/ccs_utils.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/__tests__/ccs_utils.js
@@ -17,7 +17,7 @@ describe('ccs_utils', () => {
const get = sinon.stub();
const config = { get };
- get.withArgs('xpack.monitoring.ccs.enabled').returns(false);
+ get.withArgs('monitoring.ui.ccs.enabled').returns(false);
// falsy string values should be ignored
const allPattern = prefixIndexPattern(config, indexPattern, '*');
@@ -32,7 +32,7 @@ describe('ccs_utils', () => {
const get = sinon.stub();
const config = { get };
- get.withArgs('xpack.monitoring.ccs.enabled').returns(true);
+ get.withArgs('monitoring.ui.ccs.enabled').returns(true);
// falsy string values should be ignored
const undefinedPattern = prefixIndexPattern(config, indexPattern);
@@ -49,7 +49,7 @@ describe('ccs_utils', () => {
const get = sinon.stub();
const config = { get };
- get.withArgs('xpack.monitoring.ccs.enabled').returns(true);
+ get.withArgs('monitoring.ui.ccs.enabled').returns(true);
const abcPattern = prefixIndexPattern(config, indexPattern, 'aBc');
const underscorePattern = prefixIndexPattern(config, indexPattern, 'cluster_one');
@@ -67,7 +67,7 @@ describe('ccs_utils', () => {
const get = sinon.stub();
const config = { get };
- get.withArgs('xpack.monitoring.ccs.enabled').returns(true);
+ get.withArgs('monitoring.ui.ccs.enabled').returns(true);
const pattern = prefixIndexPattern(config, indexPattern, '*');
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/apm/get_apms.js b/x-pack/legacy/plugins/monitoring/server/lib/apm/get_apms.js
index ef8db59620f1a5..40070a6b0d0f24 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/apm/get_apms.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/apm/get_apms.js
@@ -84,7 +84,7 @@ export async function getApms(req, apmIndexPattern, clusterUuid) {
const params = {
index: apmIndexPattern,
- size: config.get('xpack.monitoring.max_bucket_size'), // FIXME
+ size: config.get('monitoring.ui.max_bucket_size'), // FIXME
ignoreUnavailable: true,
filterPath: [
// only filter path can filter for inner_hits
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/apm/get_apms_for_clusters.js b/x-pack/legacy/plugins/monitoring/server/lib/apm/get_apms_for_clusters.js
index 95ccb81f696be1..a24936dc0f8320 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/apm/get_apms_for_clusters.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/apm/get_apms_for_clusters.js
@@ -35,7 +35,7 @@ export function getApmsForClusters(req, apmIndexPattern, clusters) {
const start = req.payload.timeRange.min;
const end = req.payload.timeRange.max;
const config = req.server.config();
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
return Promise.all(
clusters.map(async cluster => {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/apm/get_stats.js b/x-pack/legacy/plugins/monitoring/server/lib/apm/get_stats.js
index 54a0609d945de2..bfaec4f8a12949 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/apm/get_stats.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/apm/get_stats.js
@@ -28,7 +28,7 @@ export async function getStats(req, apmIndexPattern, clusterUuid) {
const config = req.server.config();
const start = moment.utc(req.payload.timeRange.min).valueOf();
const end = moment.utc(req.payload.timeRange.max).valueOf();
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
const params = {
index: apmIndexPattern,
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/beats/get_beats.js b/x-pack/legacy/plugins/monitoring/server/lib/beats/get_beats.js
index 5857ec32b22597..ef878e48925570 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/beats/get_beats.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/beats/get_beats.js
@@ -83,7 +83,7 @@ export async function getBeats(req, beatsIndexPattern, clusterUuid) {
const params = {
index: beatsIndexPattern,
- size: config.get('xpack.monitoring.max_bucket_size'), // FIXME
+ size: config.get('monitoring.ui.max_bucket_size'), // FIXME
ignoreUnavailable: true,
filterPath: [
// only filter path can filter for inner_hits
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/beats/get_beats_for_clusters.js b/x-pack/legacy/plugins/monitoring/server/lib/beats/get_beats_for_clusters.js
index 82a738755931d6..624abb894e5087 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/beats/get_beats_for_clusters.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/beats/get_beats_for_clusters.js
@@ -34,7 +34,7 @@ export function getBeatsForClusters(req, beatsIndexPattern, clusters) {
const start = req.payload.timeRange.min;
const end = req.payload.timeRange.max;
const config = req.server.config();
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
return Promise.all(
clusters.map(async cluster => {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/beats/get_latest_stats.js b/x-pack/legacy/plugins/monitoring/server/lib/beats/get_latest_stats.js
index d326c84634e12d..1139489728dbfa 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/beats/get_latest_stats.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/beats/get_latest_stats.js
@@ -71,7 +71,7 @@ export function getLatestStats(req, beatsIndexPattern, clusterUuid) {
uuids: {
terms: {
field: 'beats_stats.beat.uuid',
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
},
},
},
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/beats/get_stats.js b/x-pack/legacy/plugins/monitoring/server/lib/beats/get_stats.js
index 80851a8498c263..0f90750a293fb7 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/beats/get_stats.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/beats/get_stats.js
@@ -28,7 +28,7 @@ export async function getStats(req, beatsIndexPattern, clusterUuid) {
const config = req.server.config();
const start = moment.utc(req.payload.timeRange.min).valueOf();
const end = moment.utc(req.payload.timeRange.max).valueOf();
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
const params = {
index: beatsIndexPattern,
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/ccs_utils.js b/x-pack/legacy/plugins/monitoring/server/lib/ccs_utils.js
index 5b3980d9619a8a..3409462156a077 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/ccs_utils.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/ccs_utils.js
@@ -16,7 +16,7 @@
* @return {String} The index pattern with the {@code cluster} prefix appropriately prepended.
*/
export function prefixIndexPattern(config, indexPattern, ccs) {
- const ccsEnabled = config.get('xpack.monitoring.ccs.enabled');
+ const ccsEnabled = config.get('monitoring.ui.ccs.enabled');
if (!ccsEnabled || !ccs) {
return indexPattern;
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js b/x-pack/legacy/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js
index d3456eeb2fe4e4..2b080a5c333fcf 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js
@@ -55,7 +55,7 @@ export async function getClustersFromRequest(
} = indexPatterns;
const config = req.server.config();
- const size = config.get('xpack.monitoring.max_bucket_size');
+ const size = config.get('monitoring.ui.max_bucket_size');
const isStandaloneCluster = clusterUuid === STANDALONE_CLUSTER_CLUSTER_UUID;
let clusters = [];
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/cluster/get_clusters_stats.js b/x-pack/legacy/plugins/monitoring/server/lib/cluster/get_clusters_stats.js
index c323cb381aaf24..54dc58a374c2c8 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/cluster/get_clusters_stats.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/cluster/get_clusters_stats.js
@@ -46,7 +46,7 @@ function fetchClusterStats(req, esIndexPattern, clusterUuid) {
const metric = ElasticsearchMetric.getMetricFields();
const params = {
index: esIndexPattern,
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
ignoreUnavailable: true,
filterPath: [
'hits.hits._index',
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/details/__test__/get_metrics.test.js b/x-pack/legacy/plugins/monitoring/server/lib/details/__test__/get_metrics.test.js
index b7c387e74ec968..fbe6c8ec4cfa3e 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/details/__test__/get_metrics.test.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/details/__test__/get_metrics.test.js
@@ -20,7 +20,7 @@ function getMockReq(metricsBuckets = []) {
get: sinon.stub(),
};
- config.get.withArgs('xpack.monitoring.min_interval_seconds').returns(10);
+ config.get.withArgs('monitoring.ui.min_interval_seconds').returns(10);
return {
server: {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/details/get_metrics.js b/x-pack/legacy/plugins/monitoring/server/lib/details/get_metrics.js
index 798a94abbe4849..0c4736e91ea109 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/details/get_metrics.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/details/get_metrics.js
@@ -28,7 +28,7 @@ export async function getMetrics(
// TODO: Pass in req parameters as explicit function parameters
let min = moment.utc(req.payload.timeRange.min).valueOf();
const max = moment.utc(req.payload.timeRange.max).valueOf();
- const minIntervalSeconds = config.get('xpack.monitoring.min_interval_seconds');
+ const minIntervalSeconds = config.get('monitoring.ui.min_interval_seconds');
const bucketSize = calculateTimeseriesInterval(min, max, minIntervalSeconds);
const timezone = await getTimezone(req);
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.js
index 658ee96c1f0841..8aef402f881e81 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.js
@@ -23,7 +23,7 @@ export function getMlJobs(req, esIndexPattern) {
checkParam(esIndexPattern, 'esIndexPattern in getMlJobs');
const config = req.server.config();
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
const start = req.payload.timeRange.min; // no wrapping in moment :)
const end = req.payload.timeRange.max;
const clusterUuid = req.params.clusterUuid;
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/indices/get_indices.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/indices/get_indices.js
index 6fe8ccfd890432..938a9b9d55e439 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/indices/get_indices.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/indices/get_indices.js
@@ -97,7 +97,7 @@ export function getIndices(req, esIndexPattern, showSystemIndices = false, shard
const params = {
index: esIndexPattern,
// TODO: composite aggregation
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
ignoreUnavailable: true,
filterPath: [
// only filter path can filter for inner_hits
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_nodes.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_nodes.js
index 7581a325909712..c248ad743e0ec8 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_nodes.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_nodes.js
@@ -44,7 +44,7 @@ export async function getNodes(req, esIndexPattern, pageOfNodes, clusterStats, n
const min = start;
const bucketSize = Math.max(
- config.get('xpack.monitoring.min_interval_seconds'),
+ config.get('monitoring.ui.min_interval_seconds'),
calculateAuto(100, duration).asSeconds()
);
@@ -59,7 +59,7 @@ export async function getNodes(req, esIndexPattern, pageOfNodes, clusterStats, n
const params = {
index: esIndexPattern,
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
ignoreUnavailable: true,
body: {
query: createQuery({
@@ -78,7 +78,7 @@ export async function getNodes(req, esIndexPattern, pageOfNodes, clusterStats, n
terms: {
field: `source_node.uuid`,
include: uuidsToInclude,
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
},
aggs: {
by_date: {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.js
index 51c61046e9cda2..e18d328e8725bb 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.js
@@ -38,7 +38,7 @@ export async function getPaginatedNodes(
{ clusterStats, nodesShardCount }
) {
const config = req.server.config();
- const size = config.get('xpack.monitoring.max_bucket_size');
+ const size = config.get('monitoring.ui.max_bucket_size');
const nodes = await getNodeIds(req, esIndexPattern, { clusterUuid }, size);
// Add `isOnline` and shards from the cluster state and shard stats
@@ -63,7 +63,7 @@ export async function getPaginatedNodes(
const groupBy = {
field: `source_node.uuid`,
include: nodes.map(node => node.uuid),
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
};
const metricSeriesData = await getMetrics(
req,
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_indices_unassigned_shard_stats.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_indices_unassigned_shard_stats.js
index e8d484e7021f47..c77bcc4f62e611 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_indices_unassigned_shard_stats.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_indices_unassigned_shard_stats.js
@@ -12,7 +12,7 @@ import { calculateIndicesTotals } from './calculate_shard_stat_indices_totals';
async function getUnassignedShardData(req, esIndexPattern, cluster) {
const config = req.server.config();
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
const metric = ElasticsearchMetric.getMetricFields();
const params = {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_nodes_shard_count.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_nodes_shard_count.js
index c11bd4aead693f..7823884dc749d4 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_nodes_shard_count.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_nodes_shard_count.js
@@ -11,7 +11,7 @@ import { ElasticsearchMetric } from '../../metrics';
async function getShardCountPerNode(req, esIndexPattern, cluster) {
const config = req.server.config();
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
const metric = ElasticsearchMetric.getMetricFields();
const params = {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_allocation.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_allocation.js
index 3be5650b7d3bc6..40412c03b0ef9d 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_allocation.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_allocation.js
@@ -55,7 +55,7 @@ export function getShardAllocation(
const metric = ElasticsearchMetric.getMetricFields();
const params = {
index: esIndexPattern,
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
ignoreUnavailable: true,
body: {
query: createQuery({ type: 'shards', clusterUuid, metric, filters }),
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_stat_aggs.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_stat_aggs.js
index eddd50612cdb13..8c4834e5d5e406 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_stat_aggs.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_stat_aggs.js
@@ -9,7 +9,7 @@
* @param {Boolean} includeNodes - whether to add the aggs for node shards
*/
export function getShardAggs(config, includeNodes, includeIndices) {
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
const aggSize = 10;
const indicesAgg = {
terms: {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas.js b/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas.js
index af6563bae682d5..c272c38f00d552 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas.js
@@ -31,7 +31,7 @@ export function getKibanas(req, kbnIndexPattern, { clusterUuid }) {
const params = {
index: kbnIndexPattern,
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
ignoreUnavailable: true,
body: {
query: createQuery({
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.js b/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.js
index dbf1c41dcf4e54..e50e8bda3c907b 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.js
@@ -49,7 +49,7 @@ export function getKibanasForClusters(req, kbnIndexPattern, clusters) {
kibana_uuids: {
terms: {
field: 'kibana_stats.kibana.uuid',
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
},
aggs: {
latest_report: {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logs/get_logs.js b/x-pack/legacy/plugins/monitoring/server/lib/logs/get_logs.js
index 7a20d7737c5e89..b876e3ba05d703 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logs/get_logs.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logs/get_logs.js
@@ -70,7 +70,7 @@ export async function getLogs(
const params = {
index: filebeatIndexPattern,
- size: Math.min(50, config.get('xpack.monitoring.elasticsearch.logFetchCount')),
+ size: Math.min(50, config.get('monitoring.ui.elasticsearch.logFetchCount')),
filterPath: [
'hits.hits._source.message',
'hits.hits._source.log.level',
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.js
index d0de2c3f5df3a1..55baa3cf10b508 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.js
@@ -60,7 +60,7 @@ export function getLogstashForClusters(req, lsIndexPattern, clusters) {
logstash_uuids: {
terms: {
field: 'logstash_stats.logstash.uuid',
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
},
aggs: {
latest_report: {
@@ -119,7 +119,7 @@ export function getLogstashForClusters(req, lsIndexPattern, clusters) {
logstash_versions: {
terms: {
field: 'logstash_stats.logstash.version',
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
},
},
pipelines_nested: {
@@ -135,7 +135,7 @@ export function getLogstashForClusters(req, lsIndexPattern, clusters) {
queue_types: {
terms: {
field: 'logstash_stats.pipelines.queue.type',
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
},
aggs: {
num_pipelines: {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_nodes.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_nodes.js
index 93b70d7b79f0a1..06696abdb031f0 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_nodes.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_nodes.js
@@ -31,7 +31,7 @@ export function getNodes(req, lsIndexPattern, { clusterUuid }) {
const params = {
index: lsIndexPattern,
- size: config.get('xpack.monitoring.max_bucket_size'), // FIXME
+ size: config.get('monitoring.ui.max_bucket_size'), // FIXME
ignoreUnavailable: true,
body: {
query: createQuery({
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_paginated_pipelines.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_paginated_pipelines.js
index ef9ef90e8f3108..ffc7e9ce1d6c28 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_paginated_pipelines.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_paginated_pipelines.js
@@ -37,7 +37,7 @@ export async function getPaginatedPipelines(
queryText
) {
const config = req.server.config();
- const size = config.get('xpack.monitoring.max_bucket_size');
+ const size = config.get('monitoring.ui.max_bucket_size');
const pipelines = await getLogstashPipelineIds(
req,
lsIndexPattern,
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline.js
index eeeffd74e91f76..35a4295de298bf 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline.js
@@ -111,7 +111,7 @@ export async function getPipeline(req, config, lsIndexPattern, clusterUuid, pipe
};
// Determine metrics' timeseries interval based on version's timespan
- const minIntervalSeconds = config.get('xpack.monitoring.min_interval_seconds');
+ const minIntervalSeconds = config.get('monitoring.ui.min_interval_seconds');
const timeseriesInterval = calculateTimeseriesInterval(
version.firstSeen,
version.lastSeen,
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_stats_aggregation.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_stats_aggregation.js
index 1858674a01b86e..d9c03819b0098b 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_stats_aggregation.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_stats_aggregation.js
@@ -171,7 +171,7 @@ export function getPipelineStatsAggregation(
logstashIndexPattern,
pipelineId,
version,
- config.get('xpack.monitoring.max_bucket_size'),
+ config.get('monitoring.ui.max_bucket_size'),
callWithRequest,
req
);
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_versions.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_versions.js
index 7dfa8d4a163ce9..7521389c379eae 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_versions.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_versions.js
@@ -37,7 +37,7 @@ function fetchPipelineVersions(...args) {
by_pipeline_hash: {
terms: {
field: 'logstash_stats.pipelines.hash',
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
order: { 'path_to_root>first_seen': 'desc' },
},
aggs: {
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js
index 49c2dff2d6080a..134dd88b36ce64 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js
@@ -130,7 +130,7 @@ export async function getPipelineVertex(
};
// Determine metrics' timeseries interval based on version's timespan
- const minIntervalSeconds = config.get('xpack.monitoring.min_interval_seconds');
+ const minIntervalSeconds = config.get('monitoring.ui.min_interval_seconds');
const timeseriesInterval = calculateTimeseriesInterval(
version.firstSeen,
version.lastSeen,
diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_vertex_stats_aggregation.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_vertex_stats_aggregation.js
index c91182188b213e..425ca5731926c6 100644
--- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_vertex_stats_aggregation.js
+++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_pipeline_vertex_stats_aggregation.js
@@ -216,7 +216,7 @@ export function getPipelineVertexStatsAggregation(
version,
vertexId,
timeSeriesIntervalInSeconds,
- config.get('xpack.monitoring.max_bucket_size'),
+ config.get('monitoring.ui.max_bucket_size'),
callWithRequest,
req
);
diff --git a/x-pack/legacy/plugins/monitoring/server/plugin.js b/x-pack/legacy/plugins/monitoring/server/plugin.js
index 163bc43945be1c..ef346e95ad0757 100644
--- a/x-pack/legacy/plugins/monitoring/server/plugin.js
+++ b/x-pack/legacy/plugins/monitoring/server/plugin.js
@@ -48,7 +48,7 @@ export class Plugin {
/*
* End-user-facing services
*/
- const uiEnabled = config.get('xpack.monitoring.ui.enabled');
+ const uiEnabled = config.get('monitoring.ui.enabled');
if (uiEnabled) {
await instantiateClient({
@@ -98,7 +98,7 @@ export class Plugin {
kbnServerStatus: kbnServer.status,
kbnServerVersion: kbnServer.version,
});
- const kibanaCollectionEnabled = config.get('xpack.monitoring.kibana.collection.enabled');
+ const kibanaCollectionEnabled = config.get('monitoring.kibana.collection.enabled');
if (kibanaCollectionEnabled) {
/*
@@ -125,14 +125,12 @@ export class Plugin {
core.injectUiAppVars('monitoring', () => {
const config = core.config();
return {
- maxBucketSize: config.get('xpack.monitoring.max_bucket_size'),
- minIntervalSeconds: config.get('xpack.monitoring.min_interval_seconds'),
+ maxBucketSize: config.get('monitoring.ui.max_bucket_size'),
+ minIntervalSeconds: config.get('monitoring.ui.min_interval_seconds'),
kbnIndex: config.get('kibana.index'),
- showLicenseExpiration: config.get('xpack.monitoring.show_license_expiration'),
- showCgroupMetricsElasticsearch: config.get(
- 'xpack.monitoring.ui.container.elasticsearch.enabled'
- ),
- showCgroupMetricsLogstash: config.get('xpack.monitoring.ui.container.logstash.enabled'), // Note, not currently used, but see https://github.com/elastic/x-pack-kibana/issues/1559 part 2
+ showLicenseExpiration: config.get('monitoring.ui.show_license_expiration'),
+ showCgroupMetricsElasticsearch: config.get('monitoring.ui.container.elasticsearch.enabled'),
+ showCgroupMetricsLogstash: config.get('monitoring.ui.container.logstash.enabled'), // Note, not currently used, but see https://github.com/elastic/x-pack-kibana/issues/1559 part 2
};
});
}
diff --git a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/elasticsearch/ccr.js b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/elasticsearch/ccr.js
index 2d4bded9fc4c85..fcdf4ad8a706c0 100644
--- a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/elasticsearch/ccr.js
+++ b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/elasticsearch/ccr.js
@@ -26,7 +26,7 @@ function getBucketScript(max, min) {
function buildRequest(req, config, esIndexPattern) {
const min = moment.utc(req.payload.timeRange.min).valueOf();
const max = moment.utc(req.payload.timeRange.max).valueOf();
- const maxBucketSize = config.get('xpack.monitoring.max_bucket_size');
+ const maxBucketSize = config.get('monitoring.ui.max_bucket_size');
const aggs = {
ops_synced_max: {
max: {
diff --git a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/elasticsearch/node_detail.js b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/elasticsearch/node_detail.js
index 10226d74ed0010..25ead723e3ddb8 100644
--- a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/elasticsearch/node_detail.js
+++ b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/elasticsearch/node_detail.js
@@ -61,7 +61,7 @@ export function esNodeRoute(server) {
metricSet = metricSetOverview;
// set the cgroup option if needed
const showCgroupMetricsElasticsearch = config.get(
- 'xpack.monitoring.ui.container.elasticsearch.enabled'
+ 'monitoring.ui.container.elasticsearch.enabled'
);
const metricCpu = metricSet.find(m => m.name === 'node_cpu_metric');
if (showCgroupMetricsElasticsearch) {
diff --git a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/logstash/node.js b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/logstash/node.js
index d5ce9d1686f8a8..bd3ae5f5c2679b 100644
--- a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/logstash/node.js
+++ b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/logstash/node.js
@@ -60,9 +60,7 @@ export function logstashNodeRoute(server) {
} else {
metricSet = metricSetOverview;
// set the cgroup option if needed
- const showCgroupMetricsLogstash = config.get(
- 'xpack.monitoring.ui.container.logstash.enabled'
- );
+ const showCgroupMetricsLogstash = config.get('monitoring.ui.container.logstash.enabled');
const metricCpu = metricSet.find(m => m.name === 'logstash_node_cpu_metric');
if (showCgroupMetricsLogstash) {
metricCpu.keys = ['logstash_node_cgroup_quota_as_cpu_utilization'];
diff --git a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/logstash/pipelines/cluster_pipeline_ids.js b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/logstash/pipelines/cluster_pipeline_ids.js
index c5fd76487cca1d..93330880babcc7 100644
--- a/x-pack/legacy/plugins/monitoring/server/routes/api/v1/logstash/pipelines/cluster_pipeline_ids.js
+++ b/x-pack/legacy/plugins/monitoring/server/routes/api/v1/logstash/pipelines/cluster_pipeline_ids.js
@@ -36,7 +36,7 @@ export function logstashClusterPipelineIdsRoute(server) {
const { ccs } = req.payload;
const clusterUuid = req.params.clusterUuid;
const lsIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_LOGSTASH, ccs);
- const size = config.get('xpack.monitoring.max_bucket_size');
+ const size = config.get('monitoring.ui.max_bucket_size');
try {
const pipelines = await getLogstashPipelineIds(req, lsIndexPattern, { clusterUuid }, size);
diff --git a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_cluster_uuids.ts b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_cluster_uuids.ts
index fc85cbe442ddff..4738ab5b8af83f 100644
--- a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_cluster_uuids.ts
+++ b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_cluster_uuids.ts
@@ -40,7 +40,7 @@ export function fetchClusterUuids({ server, callCluster, start, end }: StatsColl
cluster_uuids: {
terms: {
field: 'cluster_uuid',
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
},
},
},
diff --git a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_es_stats.js b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_es_stats.js
index 8e5a59361e52f7..52d34258b5fa4d 100644
--- a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_es_stats.js
+++ b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_es_stats.js
@@ -31,7 +31,7 @@ export function fetchElasticsearchStats(server, callCluster, clusterUuids) {
const config = server.config();
const params = {
index: INDEX_PATTERN_ELASTICSEARCH,
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
ignoreUnavailable: true,
filterPath: [
'hits.hits._source.cluster_uuid',
diff --git a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_high_level_stats.js b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_high_level_stats.js
index 2632a8f6e041df..b87f632308e4d6 100644
--- a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_high_level_stats.js
+++ b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_high_level_stats.js
@@ -217,7 +217,7 @@ export async function fetchHighLevelStats(server, callCluster, clusterUuids, sta
const params = {
index: getIndexPatternForStackProduct(product),
- size: config.get('xpack.monitoring.max_bucket_size'),
+ size: config.get('monitoring.ui.max_bucket_size'),
headers: {
'X-QUERY-SOURCE': TELEMETRY_QUERY_SOURCE,
},
diff --git a/x-pack/legacy/plugins/monitoring/ui_exports.js b/x-pack/legacy/plugins/monitoring/ui_exports.js
index 2b5ea21a2bb452..9251deb673bd11 100644
--- a/x-pack/legacy/plugins/monitoring/ui_exports.js
+++ b/x-pack/legacy/plugins/monitoring/ui_exports.js
@@ -32,7 +32,7 @@ export const getUiExports = () => ({
injectDefaultVars(server) {
const config = server.config();
return {
- monitoringUiEnabled: config.get('xpack.monitoring.ui.enabled'),
+ monitoringUiEnabled: config.get('monitoring.ui.enabled'),
};
},
hacks: ['plugins/monitoring/hacks/toggle_app_link_in_nav'],
From 877985ca92db9990a55c1e8591abee1fbaf25e24 Mon Sep 17 00:00:00 2001
From: Corey Robertson
Date: Thu, 30 Jan 2020 11:15:01 -0500
Subject: [PATCH 19/69] Import appropriate files to setup plugin system at the
correct time (#55956)
Co-authored-by: Elastic Machine
---
x-pack/legacy/plugins/canvas/public/legacy_start.ts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/x-pack/legacy/plugins/canvas/public/legacy_start.ts b/x-pack/legacy/plugins/canvas/public/legacy_start.ts
index 972427e166afcd..21bf5aaa6d8184 100644
--- a/x-pack/legacy/plugins/canvas/public/legacy_start.ts
+++ b/x-pack/legacy/plugins/canvas/public/legacy_start.ts
@@ -16,6 +16,12 @@ import 'uiExports/spyModes';
import 'uiExports/embeddableFactories';
import 'uiExports/interpreter';
+// TODO: These dependencies should be moved into plugin startup methods
+// Load the interpreter so that the kbnInterpreter global will be available when plugins load
+import 'plugins/interpreter/interpreter';
+// Load our app component to initialize registries
+import './components/app';
+
// load application code
import 'uiExports/canvas';
From 349851ca7be822a9d88419011df0515548f1b0a2 Mon Sep 17 00:00:00 2001
From: Corey Robertson
Date: Thu, 30 Jan 2020 11:15:46 -0500
Subject: [PATCH 20/69] Only fire appState changes when there is a change
(#56183)
Co-authored-by: Elastic Machine
---
.../canvas/public/components/router/index.js | 23 -------
.../canvas/public/components/router/index.ts | 63 +++++++++++++++++++
.../plugins/canvas/public/lib/app_state.ts | 11 +++-
3 files changed, 71 insertions(+), 26 deletions(-)
delete mode 100644 x-pack/legacy/plugins/canvas/public/components/router/index.js
create mode 100644 x-pack/legacy/plugins/canvas/public/components/router/index.ts
diff --git a/x-pack/legacy/plugins/canvas/public/components/router/index.js b/x-pack/legacy/plugins/canvas/public/components/router/index.js
deleted file mode 100644
index 430d6a53436624..00000000000000
--- a/x-pack/legacy/plugins/canvas/public/components/router/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { connect } from 'react-redux';
-import { setFullscreen } from '../../state/actions/transient';
-import {
- enableAutoplay,
- setRefreshInterval,
- setAutoplayInterval,
-} from '../../state/actions/workpad';
-import { Router as Component } from './router';
-
-const mapDispatchToState = {
- enableAutoplay,
- setAutoplayInterval,
- setFullscreen,
- setRefreshInterval,
-};
-
-export const Router = connect(null, mapDispatchToState)(Component);
diff --git a/x-pack/legacy/plugins/canvas/public/components/router/index.ts b/x-pack/legacy/plugins/canvas/public/components/router/index.ts
new file mode 100644
index 00000000000000..5e014870f5158a
--- /dev/null
+++ b/x-pack/legacy/plugins/canvas/public/components/router/index.ts
@@ -0,0 +1,63 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { connect } from 'react-redux';
+// @ts-ignore untyped local
+import { setFullscreen } from '../../state/actions/transient';
+import {
+ enableAutoplay,
+ setRefreshInterval,
+ setAutoplayInterval,
+ // @ts-ignore untyped local
+} from '../../state/actions/workpad';
+// @ts-ignore untyped local
+import { Router as Component } from './router';
+import { State } from '../../../types';
+
+const mapDispatchToProps = {
+ enableAutoplay,
+ setAutoplayInterval,
+ setFullscreen,
+ setRefreshInterval,
+};
+
+const mapStateToProps = (state: State) => ({
+ refreshInterval: state.transient.refresh.interval,
+ autoplayInterval: state.transient.autoplay.interval,
+ autoplay: state.transient.autoplay.enabled,
+ fullscreen: state.transient.fullScreen,
+});
+
+export const Router = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+ (stateProps, dispatchProps, ownProps) => {
+ return {
+ ...ownProps,
+ ...dispatchProps,
+ setRefreshInterval: (interval: number) => {
+ if (interval !== stateProps.refreshInterval) {
+ dispatchProps.setRefreshInterval(interval);
+ }
+ },
+ setAutoplayInterval: (interval: number) => {
+ if (interval !== stateProps.autoplayInterval) {
+ dispatchProps.setRefreshInterval(interval);
+ }
+ },
+ enableAutoplay: (autoplay: boolean) => {
+ if (autoplay !== stateProps.autoplay) {
+ dispatchProps.enableAutoplay(autoplay);
+ }
+ },
+ setFullscreen: (fullscreen: boolean) => {
+ if (fullscreen !== stateProps.fullscreen) {
+ dispatchProps.setFullscreen(fullscreen);
+ }
+ },
+ };
+ }
+)(Component);
diff --git a/x-pack/legacy/plugins/canvas/public/lib/app_state.ts b/x-pack/legacy/plugins/canvas/public/lib/app_state.ts
index 955125b7131400..c93e505c595fd0 100644
--- a/x-pack/legacy/plugins/canvas/public/lib/app_state.ts
+++ b/x-pack/legacy/plugins/canvas/public/lib/app_state.ts
@@ -13,7 +13,7 @@ import { getWindow } from './get_window';
import { historyProvider } from './history_provider';
// @ts-ignore untyped local
import { routerProvider } from './router_provider';
-import { createTimeInterval, isValidTimeInterval } from './time_interval';
+import { createTimeInterval, isValidTimeInterval, getTimeInterval } from './time_interval';
import { AppState, AppStateKeys } from '../../types';
export function getDefaultAppState(): AppState {
@@ -112,7 +112,12 @@ export function setRefreshInterval(payload: string) {
const appValue = appState[AppStateKeys.REFRESH_INTERVAL];
if (payload !== appValue) {
- appState[AppStateKeys.REFRESH_INTERVAL] = payload;
- routerProvider().updateAppState(appState);
+ if (getTimeInterval(payload)) {
+ appState[AppStateKeys.REFRESH_INTERVAL] = payload;
+ routerProvider().updateAppState(appState);
+ } else {
+ delete appState[AppStateKeys.REFRESH_INTERVAL];
+ routerProvider().updateAppState(appState);
+ }
}
}
From 8a4d68092b90c271262b524d7c7a8ffbcce3ffc4 Mon Sep 17 00:00:00 2001
From: Brittany Joiner
Date: Thu, 30 Jan 2020 11:59:14 -0500
Subject: [PATCH 21/69] Sync badge (#55113)
* adding span sync badge on waterfall and flyout
---
.../Waterfall/SpanFlyout/index.tsx | 2 +
.../Waterfall/SyncBadge.stories.tsx | 44 ++++++++++++++++++
.../Waterfall/SyncBadge.tsx | 46 +++++++++++++++++++
.../Waterfall/WaterfallItem.tsx | 2 +
4 files changed, 94 insertions(+)
create mode 100644 x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SyncBadge.stories.tsx
create mode 100644 x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SyncBadge.tsx
diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/index.tsx
index 4863d6519de070..6f93762e11a82c 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/index.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/index.tsx
@@ -34,6 +34,7 @@ import { DatabaseContext } from './DatabaseContext';
import { StickySpanProperties } from './StickySpanProperties';
import { HttpInfoSummaryItem } from '../../../../../../shared/Summary/HttpInfoSummaryItem';
import { SpanMetadata } from '../../../../../../shared/MetadataTable/SpanMetadata';
+import { SyncBadge } from '../SyncBadge';
function formatType(type: string) {
switch (type) {
@@ -188,6 +189,7 @@ export function SpanFlyout({
{spanTypes.spanAction}
)}
+
>
]}
/>
diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SyncBadge.stories.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SyncBadge.stories.tsx
new file mode 100644
index 00000000000000..c7d3f6cc6f0c6e
--- /dev/null
+++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SyncBadge.stories.tsx
@@ -0,0 +1,44 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { storiesOf } from '@storybook/react';
+import React from 'react';
+import { SyncBadge } from './SyncBadge';
+
+storiesOf('app/TransactionDetails/SyncBadge', module)
+ .add(
+ 'sync=true',
+ () => {
+ return ;
+ },
+ {
+ info: {
+ source: false
+ }
+ }
+ )
+ .add(
+ 'sync=false',
+ () => {
+ return ;
+ },
+ {
+ info: {
+ source: false
+ }
+ }
+ )
+ .add(
+ 'sync=undefined',
+ () => {
+ return ;
+ },
+ {
+ info: {
+ source: false
+ }
+ }
+ );
diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SyncBadge.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SyncBadge.tsx
new file mode 100644
index 00000000000000..764f15f943ad2b
--- /dev/null
+++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SyncBadge.tsx
@@ -0,0 +1,46 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { EuiBadge } from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import React from 'react';
+import styled from 'styled-components';
+import { px, units } from '../../../../../../style/variables';
+
+const SpanBadge = styled(EuiBadge)`
+ display: inline-block;
+ margin-right: ${px(units.quarter)};
+`;
+
+interface SyncBadgeProps {
+ /**
+ * Is the request synchronous? True will show blocking, false will show async.
+ */
+ sync?: boolean;
+}
+
+export function SyncBadge({ sync }: SyncBadgeProps) {
+ switch (sync) {
+ case true:
+ return (
+
+ {i18n.translate('xpack.apm.transactionDetails.syncBadgeBlocking', {
+ defaultMessage: 'blocking'
+ })}
+
+ );
+ case false:
+ return (
+
+ {i18n.translate('xpack.apm.transactionDetails.syncBadgeAsync', {
+ defaultMessage: 'async'
+ })}
+
+ );
+ default:
+ return null;
+ }
+}
diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/WaterfallItem.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/WaterfallItem.tsx
index 8a82547d717db2..f57ccc3c344679 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/WaterfallItem.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/WaterfallItem.tsx
@@ -17,6 +17,7 @@ import { ErrorCount } from '../../ErrorCount';
import { IWaterfallItem } from './waterfall_helpers/waterfall_helpers';
import { ErrorOverviewLink } from '../../../../../shared/Links/apm/ErrorOverviewLink';
import { TRACE_ID } from '../../../../../../../common/elasticsearch_fieldnames';
+import { SyncBadge } from './SyncBadge';
type ItemType = 'transaction' | 'span' | 'error';
@@ -231,6 +232,7 @@ export function WaterfallItem({
) : null}
+ {item.docType === 'span' && }
);
From b7bcff71deab515331c5b6223f75d67196b9f60a Mon Sep 17 00:00:00 2001
From: Jimmy Kuang
Date: Thu, 30 Jan 2020 10:30:14 -0800
Subject: [PATCH 22/69] System index templates can't be edited (#55229)
* Removed period validation
* Add back period validation
* Fix EsLint
* Undo Snapshot changes from Index Management bug
* Undo Capitalization
Co-authored-by: Elastic Machine
---
.../template_form/steps/step_logistics.tsx | 3 +-
.../template_form/template_form_schemas.tsx | 124 +++++++++---------
2 files changed, 65 insertions(+), 62 deletions(-)
diff --git a/x-pack/legacy/plugins/index_management/public/app/components/template_form/steps/step_logistics.tsx b/x-pack/legacy/plugins/index_management/public/app/components/template_form/steps/step_logistics.tsx
index 290ade35045512..d2134837c15e52 100644
--- a/x-pack/legacy/plugins/index_management/public/app/components/template_form/steps/step_logistics.tsx
+++ b/x-pack/legacy/plugins/index_management/public/app/components/template_form/steps/step_logistics.tsx
@@ -18,7 +18,7 @@ import {
} from '../../../../../../../../../src/plugins/es_ui_shared/static/forms/components';
import { documentationService } from '../../../services/documentation';
import { StepProps } from '../types';
-import { schemas } from '../template_form_schemas';
+import { schemas, nameConfig, nameConfigWithoutValidations } from '../template_form_schemas';
// Create or Form components with partial props that are common to all instances
const UseField = getUseField({ component: Field });
@@ -131,6 +131,7 @@ export const StepLogistics: React.FunctionComponent = ({
['data-test-subj']: name.testSubject,
euiFieldProps: { disabled: isEditing },
}}
+ config={isEditing ? nameConfigWithoutValidations : nameConfig}
/>
{/* Index patterns */}
diff --git a/x-pack/legacy/plugins/index_management/public/app/components/template_form/template_form_schemas.tsx b/x-pack/legacy/plugins/index_management/public/app/components/template_form/template_form_schemas.tsx
index 5f3e28ddffb8ef..ed2616cc64e381 100644
--- a/x-pack/legacy/plugins/index_management/public/app/components/template_form/template_form_schemas.tsx
+++ b/x-pack/legacy/plugins/index_management/public/app/components/template_form/template_form_schemas.tsx
@@ -12,6 +12,7 @@ import {
FormSchema,
FIELD_TYPES,
VALIDATION_TYPES,
+ FieldConfig,
} from '../../../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib';
import {
@@ -34,70 +35,71 @@ const {
const { toInt } = fieldFormatters;
const indexPatternInvalidCharacters = INVALID_INDEX_PATTERN_CHARS.join(' ');
-export const schemas: Record = {
- logistics: {
- name: {
- type: FIELD_TYPES.TEXT,
- label: i18n.translate('xpack.idxMgmt.templateForm.stepLogistics.fieldNameLabel', {
- defaultMessage: 'Name',
+export const nameConfig: FieldConfig = {
+ type: FIELD_TYPES.TEXT,
+ label: i18n.translate('xpack.idxMgmt.templateForm.stepLogistics.fieldNameLabel', {
+ defaultMessage: 'Name',
+ }),
+ validations: [
+ {
+ validator: emptyField(
+ i18n.translate('xpack.idxMgmt.templateValidation.templateNameRequiredError', {
+ defaultMessage: 'A template name is required.',
+ })
+ ),
+ },
+ {
+ validator: containsCharsField({
+ chars: ' ',
+ message: i18n.translate('xpack.idxMgmt.templateValidation.templateNameSpacesError', {
+ defaultMessage: 'Spaces are not allowed in a template name.',
+ }),
}),
- validations: [
- {
- validator: emptyField(
- i18n.translate('xpack.idxMgmt.templateValidation.templateNameRequiredError', {
- defaultMessage: 'A template name is required.',
- })
- ),
- },
- {
- validator: containsCharsField({
- chars: ' ',
- message: i18n.translate('xpack.idxMgmt.templateValidation.templateNameSpacesError', {
- defaultMessage: 'Spaces are not allowed in a template name.',
- }),
- }),
- },
- {
- validator: startsWithField({
- char: '_',
- message: i18n.translate(
- 'xpack.idxMgmt.templateValidation.templateNameUnderscoreError',
- {
- defaultMessage: 'A template name must not start with an underscore.',
- }
- ),
- }),
- },
- {
- validator: startsWithField({
- char: '.',
- message: i18n.translate('xpack.idxMgmt.templateValidation.templateNamePeriodError', {
- defaultMessage: 'A template name must not start with a period.',
- }),
- }),
- },
- {
- validator: containsCharsField({
- chars: INVALID_TEMPLATE_NAME_CHARS,
- message: ({ charsFound }) =>
- i18n.translate(
- 'xpack.idxMgmt.templateValidation.templateNameInvalidaCharacterError',
- {
- defaultMessage: 'A template name must not contain the character "{invalidChar}"',
- values: { invalidChar: charsFound[0] },
- }
- ),
+ },
+ {
+ validator: startsWithField({
+ char: '_',
+ message: i18n.translate('xpack.idxMgmt.templateValidation.templateNameUnderscoreError', {
+ defaultMessage: 'A template name must not start with an underscore.',
+ }),
+ }),
+ },
+ {
+ validator: startsWithField({
+ char: '.',
+ message: i18n.translate('xpack.idxMgmt.templateValidation.templateNamePeriodError', {
+ defaultMessage: 'A template name must not start with a period.',
+ }),
+ }),
+ },
+ {
+ validator: containsCharsField({
+ chars: INVALID_TEMPLATE_NAME_CHARS,
+ message: ({ charsFound }) =>
+ i18n.translate('xpack.idxMgmt.templateValidation.templateNameInvalidaCharacterError', {
+ defaultMessage: 'A template name must not contain the character "{invalidChar}"',
+ values: { invalidChar: charsFound[0] },
}),
- },
- {
- validator: lowerCaseStringField(
- i18n.translate('xpack.idxMgmt.templateValidation.templateNameLowerCaseRequiredError', {
- defaultMessage: 'The template name must be in lowercase.',
- })
- ),
- },
- ],
+ }),
},
+ {
+ validator: lowerCaseStringField(
+ i18n.translate('xpack.idxMgmt.templateValidation.templateNameLowerCaseRequiredError', {
+ defaultMessage: 'The template name must be in lowercase.',
+ })
+ ),
+ },
+ ],
+};
+
+export const nameConfigWithoutValidations: FieldConfig = {
+ ...nameConfig,
+ validations: [],
+};
+
+export const schemas: Record = {
+ logistics: {
+ name: nameConfig,
indexPatterns: {
type: FIELD_TYPES.COMBO_BOX,
defaultValue: [],
From 2b53c74cd9c1889b84a817b7a2817a839a9b5adf Mon Sep 17 00:00:00 2001
From: Tiago Costa
Date: Thu, 30 Jan 2020 19:03:14 +0000
Subject: [PATCH 23/69] chore(NA): delete data/optimize with kbn clean (#55890)
Co-authored-by: Elastic Machine
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9707d3863d295d..425527a058e862 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,7 @@
"clean": {
"extraPatterns": [
"build",
- "optimize",
+ "data/optimize",
"built_assets",
".eslintcache",
".node_binaries"
From 8398a1c77cde0e190126ff13804d182fda96e74d Mon Sep 17 00:00:00 2001
From: Dan Panzarella
Date: Thu, 30 Jan 2020 14:25:56 -0500
Subject: [PATCH 24/69] [Endpoint] Add Endpoint Details route (#55746)
* Add Endpoint Details route
* add Endpoint Details tests
* sacrifices to the Type gods
* update to latest endpoint schema
Co-authored-by: Elastic Machine
---
.../endpoint/server/routes/endpoints.test.ts | 78 +++++++++++++++++++
.../endpoint/server/routes/endpoints.ts | 32 +++++++-
.../endpoint/endpoint_query_builders.test.ts | 32 +++++++-
.../endpoint/endpoint_query_builders.ts | 24 ++++++
4 files changed, 162 insertions(+), 4 deletions(-)
diff --git a/x-pack/plugins/endpoint/server/routes/endpoints.test.ts b/x-pack/plugins/endpoint/server/routes/endpoints.test.ts
index 04a38972401ed9..be14554f128c3c 100644
--- a/x-pack/plugins/endpoint/server/routes/endpoints.test.ts
+++ b/x-pack/plugins/endpoint/server/routes/endpoints.test.ts
@@ -120,4 +120,82 @@ describe('test endpoint route', () => {
expect(endpointResultList.request_page_index).toEqual(10);
expect(endpointResultList.request_page_size).toEqual(10);
});
+
+ describe('Endpoint Details route', () => {
+ it('should return 404 on no results', async () => {
+ const mockRequest = httpServerMock.createKibanaRequest({ params: { id: 'BADID' } });
+ mockScopedClient.callAsCurrentUser.mockImplementationOnce(() =>
+ Promise.resolve({
+ took: 3,
+ timed_out: false,
+ _shards: {
+ total: 1,
+ successful: 1,
+ skipped: 0,
+ failed: 0,
+ },
+ hits: {
+ total: {
+ value: 9,
+ relation: 'eq',
+ },
+ max_score: null,
+ hits: [],
+ },
+ })
+ );
+ [routeConfig, routeHandler] = routerMock.get.mock.calls.find(([{ path }]) =>
+ path.startsWith('/api/endpoint/endpoints')
+ )!;
+
+ await routeHandler(
+ ({
+ core: {
+ elasticsearch: {
+ dataClient: mockScopedClient,
+ },
+ },
+ } as unknown) as RequestHandlerContext,
+ mockRequest,
+ mockResponse
+ );
+
+ expect(mockScopedClient.callAsCurrentUser).toBeCalled();
+ expect(routeConfig.options).toEqual({ authRequired: true });
+ expect(mockResponse.notFound).toBeCalled();
+ const message = mockResponse.notFound.mock.calls[0][0]?.body;
+ expect(message).toEqual('Endpoint Not Found');
+ });
+
+ it('should return a single endpoint', async () => {
+ const mockRequest = httpServerMock.createKibanaRequest({
+ params: { id: (data as any).hits.hits[0]._id },
+ });
+ const response: SearchResponse = (data as unknown) as SearchResponse<
+ EndpointMetadata
+ >;
+ mockScopedClient.callAsCurrentUser.mockImplementationOnce(() => Promise.resolve(response));
+ [routeConfig, routeHandler] = routerMock.get.mock.calls.find(([{ path }]) =>
+ path.startsWith('/api/endpoint/endpoints')
+ )!;
+
+ await routeHandler(
+ ({
+ core: {
+ elasticsearch: {
+ dataClient: mockScopedClient,
+ },
+ },
+ } as unknown) as RequestHandlerContext,
+ mockRequest,
+ mockResponse
+ );
+
+ expect(mockScopedClient.callAsCurrentUser).toBeCalled();
+ expect(routeConfig.options).toEqual({ authRequired: true });
+ expect(mockResponse.ok).toBeCalled();
+ const result = mockResponse.ok.mock.calls[0][0]?.body as EndpointMetadata;
+ expect(result).toHaveProperty('endpoint');
+ });
+ });
});
diff --git a/x-pack/plugins/endpoint/server/routes/endpoints.ts b/x-pack/plugins/endpoint/server/routes/endpoints.ts
index 4fc3e653f94265..24ad8e3941f5e1 100644
--- a/x-pack/plugins/endpoint/server/routes/endpoints.ts
+++ b/x-pack/plugins/endpoint/server/routes/endpoints.ts
@@ -8,7 +8,10 @@ import { IRouter } from 'kibana/server';
import { SearchResponse } from 'elasticsearch';
import { schema } from '@kbn/config-schema';
-import { kibanaRequestToEndpointListQuery } from '../services/endpoint/endpoint_query_builders';
+import {
+ kibanaRequestToEndpointListQuery,
+ kibanaRequestToEndpointFetchQuery,
+} from '../services/endpoint/endpoint_query_builders';
import { EndpointMetadata, EndpointResultList } from '../../common/types';
import { EndpointAppContext } from '../types';
@@ -51,6 +54,33 @@ export function registerEndpointRoutes(router: IRouter, endpointAppContext: Endp
}
}
);
+
+ router.get(
+ {
+ path: '/api/endpoint/endpoints/{id}',
+ validate: {
+ params: schema.object({ id: schema.string() }),
+ },
+ options: { authRequired: true },
+ },
+ async (context, req, res) => {
+ try {
+ const query = kibanaRequestToEndpointFetchQuery(req, endpointAppContext);
+ const response = (await context.core.elasticsearch.dataClient.callAsCurrentUser(
+ 'search',
+ query
+ )) as SearchResponse;
+
+ if (response.hits.hits.length === 0) {
+ return res.notFound({ body: 'Endpoint Not Found' });
+ }
+
+ return res.ok({ body: response.hits.hits[0]._source });
+ } catch (err) {
+ return res.internalError({ body: err });
+ }
+ }
+ );
}
function mapToEndpointResultList(
diff --git a/x-pack/plugins/endpoint/server/services/endpoint/endpoint_query_builders.test.ts b/x-pack/plugins/endpoint/server/services/endpoint/endpoint_query_builders.test.ts
index 3c931a251d6977..e453f777fbd502 100644
--- a/x-pack/plugins/endpoint/server/services/endpoint/endpoint_query_builders.test.ts
+++ b/x-pack/plugins/endpoint/server/services/endpoint/endpoint_query_builders.test.ts
@@ -5,10 +5,13 @@
*/
import { httpServerMock, loggingServiceMock } from '../../../../../../src/core/server/mocks';
import { EndpointConfigSchema } from '../../config';
-import { kibanaRequestToEndpointListQuery } from './endpoint_query_builders';
+import {
+ kibanaRequestToEndpointListQuery,
+ kibanaRequestToEndpointFetchQuery,
+} from './endpoint_query_builders';
-describe('test query builder', () => {
- describe('test query builder request processing', () => {
+describe('query builder', () => {
+ describe('EndpointListQuery', () => {
it('test default query params for all endpoints when no params or body is provided', async () => {
const mockRequest = httpServerMock.createKibanaRequest({
body: {},
@@ -51,4 +54,27 @@ describe('test query builder', () => {
} as Record);
});
});
+
+ describe('EndpointFetchQuery', () => {
+ it('searches for the correct ID', () => {
+ const mockID = 'AABBCCDD-0011-2233-AA44-DEADBEEF8899';
+ const mockRequest = httpServerMock.createKibanaRequest({
+ params: {
+ id: mockID,
+ },
+ });
+ const query = kibanaRequestToEndpointFetchQuery(mockRequest, {
+ logFactory: loggingServiceMock.create(),
+ config: () => Promise.resolve(EndpointConfigSchema.validate({})),
+ });
+ expect(query).toEqual({
+ body: {
+ query: { match: { 'host.id.keyword': mockID } },
+ sort: [{ 'event.created': { order: 'desc' } }],
+ size: 1,
+ },
+ index: 'endpoint-agent*',
+ });
+ });
+ });
});
diff --git a/x-pack/plugins/endpoint/server/services/endpoint/endpoint_query_builders.ts b/x-pack/plugins/endpoint/server/services/endpoint/endpoint_query_builders.ts
index 102c268cf9ec4c..b4f295a64b6ea0 100644
--- a/x-pack/plugins/endpoint/server/services/endpoint/endpoint_query_builders.ts
+++ b/x-pack/plugins/endpoint/server/services/endpoint/endpoint_query_builders.ts
@@ -65,3 +65,27 @@ async function getPagingProperties(
pageIndex: pagingProperties.page_index || config.endpointResultListDefaultFirstPageIndex,
};
}
+
+export const kibanaRequestToEndpointFetchQuery = (
+ request: KibanaRequest,
+ endpointAppContext: EndpointAppContext
+) => {
+ return {
+ body: {
+ query: {
+ match: {
+ 'host.id.keyword': request.params.id,
+ },
+ },
+ sort: [
+ {
+ 'event.created': {
+ order: 'desc',
+ },
+ },
+ ],
+ size: 1,
+ },
+ index: EndpointAppConstants.ENDPOINT_INDEX_NAME,
+ };
+};
From 642c694117ac3dcea33c6597a33b94cb276a75d4 Mon Sep 17 00:00:00 2001
From: Jonathan Budzenski
Date: Thu, 30 Jan 2020 13:55:17 -0600
Subject: [PATCH 25/69] Add missing docker settings (#56411)
Closes #54811
---
.../resources/bin/kibana-docker | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker
index 7a82ca0b1609c0..34ba25f92beb6a 100755
--- a/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker
+++ b/src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker
@@ -18,6 +18,11 @@ kibana_vars=(
console.enabled
console.proxyConfig
console.proxyFilter
+ cpu.cgroup.path.override
+ cpuacct.cgroup.path.override
+ csp.rules
+ csp.strict
+ csp.warnLegacyBrowsers
elasticsearch.customHeaders
elasticsearch.hosts
elasticsearch.logQueries
@@ -30,6 +35,7 @@ kibana_vars=(
elasticsearch.sniffInterval
elasticsearch.sniffOnConnectionFault
elasticsearch.sniffOnStart
+ elasticsearch.ssl.alwaysPresentCertificate
elasticsearch.ssl.certificate
elasticsearch.ssl.certificateAuthorities
elasticsearch.ssl.key
@@ -42,9 +48,13 @@ kibana_vars=(
elasticsearch.startupTimeout
elasticsearch.username
i18n.locale
+ interpreter.enableInVisualize
+ kibana.autocompleteTerminateAfter
+ kibana.autocompleteTimeout
kibana.defaultAppId
kibana.index
logging.dest
+ logging.json
logging.quiet
logging.rotate.enabled
logging.rotate.everyBytes
@@ -55,18 +65,32 @@ kibana_vars=(
logging.useUTC
logging.verbose
map.includeElasticMapsService
+ map.proxyElasticMapsServiceInMaps
+ map.regionmap
+ map.tilemap.options.attribution
+ map.tilemap.options.maxZoom
+ map.tilemap.options.minZoom
+ map.tilemap.options.subdomains
+ map.tilemap.url
+ newsfeed.enabled
ops.interval
path.data
pid.file
regionmap
server.basePath
server.customResponseHeaders
+ server.compression.enabled
+ server.compression.referrerWhitelist
+ server.cors
+ server.cors.origin
server.defaultRoute
server.host
+ server.keepAliveTimeout
server.maxPayloadBytes
server.name
server.port
server.rewriteBasePath
+ server.socketTimeout
server.ssl.cert
server.ssl.certificate
server.ssl.certificateAuthorities
@@ -82,6 +106,7 @@ kibana_vars=(
server.ssl.truststore.password
server.ssl.redirectHttpFromPort
server.ssl.supportedProtocols
+ server.xsrf.disableProtection
server.xsrf.whitelist
status.allowAnonymous
status.v6ApiFormat
@@ -96,11 +121,13 @@ kibana_vars=(
xpack.apm.serviceMapEnabled
xpack.apm.ui.enabled
xpack.apm.ui.maxTraceItems
+ xpack.apm.ui.transactionGroupBucketSize
apm_oss.apmAgentConfigurationIndex
apm_oss.indexPattern
apm_oss.errorIndices
apm_oss.onboardingIndices
apm_oss.spanIndices
+ apm_oss.sourcemapIndices
apm_oss.transactionIndices
apm_oss.metricsIndices
xpack.canvas.enabled
@@ -116,6 +143,8 @@ kibana_vars=(
xpack.code.security.gitHostWhitelist
xpack.code.security.gitProtocolWhitelist
xpack.graph.enabled
+ xpack.graph.canEditDrillDownUrls
+ xpack.graph.savePolicy
xpack.grokdebugger.enabled
xpack.infra.enabled
xpack.infra.query.partitionFactor
@@ -128,11 +157,14 @@ kibana_vars=(
xpack.infra.sources.default.fields.timestamp
xpack.infra.sources.default.logAlias
xpack.infra.sources.default.metricAlias
+ xpack.license_management.enabled
xpack.ml.enabled
+ xpack.monitoring.cluster_alerts.email_notifications.email_address
xpack.monitoring.elasticsearch.password
xpack.monitoring.elasticsearch.pingTimeout
xpack.monitoring.elasticsearch.hosts
xpack.monitoring.elasticsearch.username
+ xpack.monitoring.elasticsearch.logFetchCount
xpack.monitoring.elasticsearch.ssl.certificateAuthorities
xpack.monitoring.elasticsearch.ssl.verificationMode
xpack.monitoring.enabled
@@ -166,6 +198,7 @@ kibana_vars=(
xpack.reporting.csv.maxSizeBytes
xpack.reporting.csv.scroll.duration
xpack.reporting.csv.scroll.size
+ xpack.reporting.capture.maxAttempts
xpack.reporting.enabled
xpack.reporting.encryptionKey
xpack.reporting.index
@@ -183,6 +216,8 @@ kibana_vars=(
xpack.reporting.queue.pollIntervalErrorMultiplier
xpack.reporting.queue.timeout
xpack.reporting.roles.allow
+ xpack.rollup.enabled
+ xpack.security.audit.enabled
xpack.searchprofiler.enabled
xpack.security.authc.providers
xpack.security.authc.oidc.realm
@@ -196,7 +231,10 @@ kibana_vars=(
xpack.security.session.idleTimeout
xpack.security.session.lifespan
xpack.security.loginAssistanceMessage
+ telemetry.allowChangingOptInStatus
telemetry.enabled
+ telemetry.optIn
+ telemetry.optInStatusUrl
telemetry.sendUsageFrom
)
From 89b3c428c21dfd6fb91d9245c7b095ebcffa3341 Mon Sep 17 00:00:00 2001
From: Dima Arnautov
Date: Thu, 30 Jan 2020 21:03:03 +0100
Subject: [PATCH 26/69] [ML] Fix Data Visualizer responsive layout (#56372)
* [ML] replace Example component with EuiListGroup
* [ML] center alignment
---
.../field_data_card/examples_list/example.tsx | 31 -------------------
.../examples_list/examples_list.tsx | 17 +++++++---
2 files changed, 12 insertions(+), 36 deletions(-)
delete mode 100644 x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/components/field_data_card/examples_list/example.tsx
diff --git a/x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/components/field_data_card/examples_list/example.tsx b/x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/components/field_data_card/examples_list/example.tsx
deleted file mode 100644
index 29fe690f4a43bb..00000000000000
--- a/x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/components/field_data_card/examples_list/example.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import React, { FC } from 'react';
-
-import { EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip } from '@elastic/eui';
-
-interface Props {
- example: string | object;
-}
-
-export const Example: FC = ({ example }) => {
- const exampleStr = typeof example === 'string' ? example : JSON.stringify(example);
-
- // Use 95% width for each example so that the truncation ellipses show up when
- // wrapped inside a tooltip.
- return (
-
-
-
-
- {exampleStr}
-
-
-
-
- );
-};
diff --git a/x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/components/field_data_card/examples_list/examples_list.tsx b/x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/components/field_data_card/examples_list/examples_list.tsx
index 0bf911c1edf862..c8eb8101154017 100644
--- a/x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/components/field_data_card/examples_list/examples_list.tsx
+++ b/x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/components/field_data_card/examples_list/examples_list.tsx
@@ -6,12 +6,10 @@
import React, { FC } from 'react';
-import { EuiSpacer, EuiText } from '@elastic/eui';
+import { EuiListGroup, EuiListGroupItem, EuiSpacer, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
-import { Example } from './example';
-
interface Props {
examples: Array;
}
@@ -22,7 +20,14 @@ export const ExamplesList: FC = ({ examples }) => {
}
const examplesContent = examples.map((example, i) => {
- return ;
+ return (
+
+ );
});
return (
@@ -39,7 +44,9 @@ export const ExamplesList: FC = ({ examples }) => {
- {examplesContent}
+
+ {examplesContent}
+
);
};
From 08e0cbc3ee90358148eafb2d14a2368004b76f15 Mon Sep 17 00:00:00 2001
From: Josh Dover
Date: Thu, 30 Jan 2020 13:05:09 -0700
Subject: [PATCH 27/69] [skip-ci] Add example for migrating pre-handlers
(#56080)
---
src/core/MIGRATION_EXAMPLES.md | 137 +++++++++++++++++++++++++++++++++
1 file changed, 137 insertions(+)
diff --git a/src/core/MIGRATION_EXAMPLES.md b/src/core/MIGRATION_EXAMPLES.md
index 568980f50117df..5517dfa7f9a23c 100644
--- a/src/core/MIGRATION_EXAMPLES.md
+++ b/src/core/MIGRATION_EXAMPLES.md
@@ -14,6 +14,7 @@ APIs to their New Platform equivalents.
- [3. New Platform shim using New Platform router](#3-new-platform-shim-using-new-platform-router)
- [4. New Platform plugin](#4-new-platform-plugin)
- [Accessing Services](#accessing-services)
+ - [Migrating Hapi "pre" handlers](#migrating-hapi-pre-handlers)
- [Chrome](#chrome)
- [Updating an application navlink](#updating-application-navlink)
- [Chromeless Applications](#chromeless-applications)
@@ -450,6 +451,142 @@ class Plugin {
}
```
+### Migrating Hapi "pre" handlers
+
+In the Legacy Platform, routes could provide a "pre" option in their config to
+register a function that should be run prior to the route handler. These
+"pre" handlers allow routes to share some business logic that may do some
+pre-work or validation. In Kibana, these are often used for license checks.
+
+The Kibana Platform's HTTP interface does not provide this functionality,
+however it is simple enough to port over using a higher-order function that can
+wrap the route handler.
+
+#### Simple example
+
+In this simple example, a pre-handler is used to either abort the request with
+an error or continue as normal. This is a simple "gate-keeping" pattern.
+
+```ts
+// Legacy pre-handler
+const licensePreRouting = (request) => {
+ const licenseInfo = getMyPluginLicenseInfo(request.server.plugins.xpack_main);
+ if (!licenseInfo.isOneOf(['gold', 'platinum', 'trial'])) {
+ throw Boom.forbidden(`You don't have the right license for MyPlugin!`);
+ }
+}
+
+server.route({
+ method: 'GET',
+ path: '/api/my-plugin/do-something',
+ config: {
+ pre: [{ method: licensePreRouting }]
+ },
+ handler: (req) => {
+ return doSomethingInteresting();
+ }
+})
+```
+
+In the Kibana Platform, the same functionality can be acheived by creating a
+function that takes a route handler (or factory for a route handler) as an
+argument and either invokes it in the successful case or returns an error
+response in the failure case.
+
+We'll call this a "high-order handler" similar to the "high-order component"
+pattern common in the React ecosystem.
+
+```ts
+// New Platform high-order handler
+const checkLicense =
(
+ handler: RequestHandler
+): RequestHandler
=> {
+ return (context, req, res) => {
+ const licenseInfo = getMyPluginLicenseInfo(context.licensing.license);
+
+ if (licenseInfo.hasAtLeast('gold')) {
+ return handler(context, req, res);
+ } else {
+ return res.forbidden({ body: `You don't have the right license for MyPlugin!` });
+ }
+ }
+}
+
+router.get(
+ { path: '/api/my-plugin/do-something', validate: false },
+ checkLicense(async (context, req, res) => {
+ const results = doSomethingInteresting();
+ return res.ok({ body: results });
+ }),
+)
+```
+
+#### Full Example
+
+In some cases, the route handler may need access to data that the pre-handler
+retrieves. In this case, you can utilize a handler _factory_ rather than a raw
+handler.
+
+```ts
+// Legacy pre-handler
+const licensePreRouting = (request) => {
+ const licenseInfo = getMyPluginLicenseInfo(request.server.plugins.xpack_main);
+ if (licenseInfo.isOneOf(['gold', 'platinum', 'trial'])) {
+ // In this case, the return value of the pre-handler is made available on
+ // whatever the 'assign' option is in the route config.
+ return licenseInfo;
+ } else {
+ // In this case, the route handler is never called and the user gets this
+ // error message
+ throw Boom.forbidden(`You don't have the right license for MyPlugin!`);
+ }
+}
+
+server.route({
+ method: 'GET',
+ path: '/api/my-plugin/do-something',
+ config: {
+ pre: [{ method: licensePreRouting, assign: 'licenseInfo' }]
+ },
+ handler: (req) => {
+ const licenseInfo = req.pre.licenseInfo;
+ return doSomethingInteresting(licenseInfo);
+ }
+})
+```
+
+In many cases, it may be simpler to duplicate the function call
+to retrieve the data again in the main handler. In this other cases, you can
+utilize a handler _factory_ rather than a raw handler as the argument to your
+high-order handler. This way the high-order handler can pass arbitrary arguments
+to the route handler.
+
+```ts
+// New Platform high-order handler
+const checkLicense =