mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[8.x] [Stack Monitoring] Switch Logs Explorer locator for Discover locator in Stack Monitoring (#200546) (#202137)
# Backport This will backport the following commits from `main` to `8.x`: - [[Stack Monitoring] Switch Logs Explorer locator for Discover locator in Stack Monitoring (#200546)](https://github.com/elastic/kibana/pull/200546) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kerry Gallagher","email":"kerry.gallagher@elastic.co"},"sourceCommit":{"committedDate":"2024-11-28T10:52:38Z","message":"[Stack Monitoring] Switch Logs Explorer locator for Discover locator in Stack Monitoring (#200546)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/200256 and\r\nhttps://github.com/elastic/kibana/issues/200218.\r\n\r\n## Overview of changes\r\n\r\n- The call to `logsShared.logViews.defineInternalLogView()` is removed\r\nas Log Views will be deprecated.\r\n- The logs indices that were previously defined via\r\n`defineInternalLogView()` are now exposed via\r\n`externalConfig.logsIndices`\r\n- As part of this change `ui.logs` from `config` is now exposed to\r\nbrowser. Given this is just an index pattern I don't believe there are\r\nany security concerns here.\r\n- `getIndexPatterns()` has been moved to common (this makes it look like\r\nthere's a lot of file changes here).\r\n- The Logs Explorer locator is swapped for the Discover locator using an\r\nad-hoc data view.\r\n - This is hidden if Discover isn't available.\r\n\r\nThe behaviour here should match exactly what we had before, as the same\r\nindices are constructed from `getIndexPatterns()` and we apply the same\r\n`query`.\r\n\r\nStack Monitoring reviewer: The path changes from moving\r\n`getIndexPatterns()` were automated so there shouldn't be any issues,\r\nbut given it's used extensively please check everything works as\r\nexpected.\r\n\r\n## Screenshots\r\n\r\n\r\n\r\n\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"3e538d67c1378dc438d9f81cb603a7965026ac0c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-logs","backport:version","v8.18.0","v8.16.2"],"title":"[Stack Monitoring] Switch Logs Explorer locator for Discover locator in Stack Monitoring","number":200546,"url":"https://github.com/elastic/kibana/pull/200546","mergeCommit":{"message":"[Stack Monitoring] Switch Logs Explorer locator for Discover locator in Stack Monitoring (#200546)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/200256 and\r\nhttps://github.com/elastic/kibana/issues/200218.\r\n\r\n## Overview of changes\r\n\r\n- The call to `logsShared.logViews.defineInternalLogView()` is removed\r\nas Log Views will be deprecated.\r\n- The logs indices that were previously defined via\r\n`defineInternalLogView()` are now exposed via\r\n`externalConfig.logsIndices`\r\n- As part of this change `ui.logs` from `config` is now exposed to\r\nbrowser. Given this is just an index pattern I don't believe there are\r\nany security concerns here.\r\n- `getIndexPatterns()` has been moved to common (this makes it look like\r\nthere's a lot of file changes here).\r\n- The Logs Explorer locator is swapped for the Discover locator using an\r\nad-hoc data view.\r\n - This is hidden if Discover isn't available.\r\n\r\nThe behaviour here should match exactly what we had before, as the same\r\nindices are constructed from `getIndexPatterns()` and we apply the same\r\n`query`.\r\n\r\nStack Monitoring reviewer: The path changes from moving\r\n`getIndexPatterns()` were automated so there shouldn't be any issues,\r\nbut given it's used extensively please check everything works as\r\nexpected.\r\n\r\n## Screenshots\r\n\r\n\r\n\r\n\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"3e538d67c1378dc438d9f81cb603a7965026ac0c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200546","number":200546,"mergeCommit":{"message":"[Stack Monitoring] Switch Logs Explorer locator for Discover locator in Stack Monitoring (#200546)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/200256 and\r\nhttps://github.com/elastic/kibana/issues/200218.\r\n\r\n## Overview of changes\r\n\r\n- The call to `logsShared.logViews.defineInternalLogView()` is removed\r\nas Log Views will be deprecated.\r\n- The logs indices that were previously defined via\r\n`defineInternalLogView()` are now exposed via\r\n`externalConfig.logsIndices`\r\n- As part of this change `ui.logs` from `config` is now exposed to\r\nbrowser. Given this is just an index pattern I don't believe there are\r\nany security concerns here.\r\n- `getIndexPatterns()` has been moved to common (this makes it look like\r\nthere's a lot of file changes here).\r\n- The Logs Explorer locator is swapped for the Discover locator using an\r\nad-hoc data view.\r\n - This is hidden if Discover isn't available.\r\n\r\nThe behaviour here should match exactly what we had before, as the same\r\nindices are constructed from `getIndexPatterns()` and we apply the same\r\n`query`.\r\n\r\nStack Monitoring reviewer: The path changes from moving\r\n`getIndexPatterns()` were automated so there shouldn't be any issues,\r\nbut given it's used extensively please check everything works as\r\nexpected.\r\n\r\n## Screenshots\r\n\r\n\r\n\r\n\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"3e538d67c1378dc438d9f81cb603a7965026ac0c"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Kerry Gallagher <kerry.gallagher@elastic.co>
This commit is contained in:
parent
ca3f5a2dc6
commit
dde108c5f5
85 changed files with 172 additions and 168 deletions
|
@ -163,6 +163,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
|
|||
'monitoring.ui.enabled (boolean?)',
|
||||
'monitoring.ui.min_interval_seconds (number?)',
|
||||
'monitoring.ui.show_license_expiration (boolean?)',
|
||||
'monitoring.ui.logs.index (string?)',
|
||||
'newsfeed.fetchInterval (duration?)',
|
||||
'newsfeed.mainInterval (duration?)',
|
||||
'newsfeed.service.pathTemplate (string?)',
|
||||
|
|
|
@ -151,11 +151,6 @@ export const METRICBEAT_INDEX_NAME_UNIQUE_TOKEN = '-mb-';
|
|||
// We use this for metricbeat migration to identify specific products that we do not have constants for
|
||||
export const ELASTICSEARCH_SYSTEM_ID = 'elasticsearch';
|
||||
|
||||
/**
|
||||
* The id of the infra source owned by the monitoring plugin.
|
||||
*/
|
||||
export const INFRA_SOURCE_ID = 'internal-stack-monitoring';
|
||||
|
||||
/*
|
||||
* These constants represent code paths within `getClustersFromRequest`
|
||||
* that an api call wants to invoke. This is meant as an optimization to
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { DS_INDEX_PATTERN_TYPES } from '../../../common/constants';
|
||||
import { MonitoringConfig } from '../..';
|
||||
import { DS_INDEX_PATTERN_TYPES } from './constants';
|
||||
import { MonitoringConfig } from '../server';
|
||||
import {
|
||||
getElasticsearchDataset,
|
||||
getKibanaDataset,
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { prefixIndexPatternWithCcs } from '../../../common/ccs_utils';
|
||||
import { prefixIndexPatternWithCcs } from './ccs_utils';
|
||||
import {
|
||||
INDEX_PATTERN_ELASTICSEARCH,
|
||||
INDEX_PATTERN_ELASTICSEARCH_ECS,
|
||||
|
@ -16,8 +16,8 @@ import {
|
|||
DS_INDEX_PATTERN_METRICS,
|
||||
INDEX_PATTERN_TYPES,
|
||||
INDEX_PATTERN_ENTERPRISE_SEARCH,
|
||||
} from '../../../common/constants';
|
||||
import { MonitoringConfig } from '../../config';
|
||||
} from './constants';
|
||||
import type { MonitoringConfig } from '../server/config';
|
||||
|
||||
interface CommonIndexPatternArgs {
|
||||
config: MonitoringConfig;
|
|
@ -26,7 +26,6 @@
|
|||
],
|
||||
"optionalPlugins": [
|
||||
"infra",
|
||||
"logsShared",
|
||||
"usageCollection",
|
||||
"home",
|
||||
"cloud",
|
||||
|
@ -41,7 +40,6 @@
|
|||
"kibanaUtils",
|
||||
"alerting",
|
||||
"kibanaReact",
|
||||
"logsShared"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -12,10 +12,8 @@ exports[`Logs should render a link to filter by cluster uuid 1`] = `
|
|||
id="xpack.monitoring.logs.listing.linkText"
|
||||
values={
|
||||
Object {
|
||||
"link": <EuiLink
|
||||
href=""
|
||||
>
|
||||
Logs
|
||||
"link": <EuiLink>
|
||||
Discover
|
||||
</EuiLink>,
|
||||
}
|
||||
}
|
||||
|
@ -36,10 +34,8 @@ exports[`Logs should render a link to filter by cluster uuid and index uuid 1`]
|
|||
id="xpack.monitoring.logs.listing.linkText"
|
||||
values={
|
||||
Object {
|
||||
"link": <EuiLink
|
||||
href=""
|
||||
>
|
||||
Logs
|
||||
"link": <EuiLink>
|
||||
Discover
|
||||
</EuiLink>,
|
||||
}
|
||||
}
|
||||
|
@ -60,10 +56,8 @@ exports[`Logs should render a link to filter by cluster uuid and node uuid 1`] =
|
|||
id="xpack.monitoring.logs.listing.linkText"
|
||||
values={
|
||||
Object {
|
||||
"link": <EuiLink
|
||||
href=""
|
||||
>
|
||||
Logs
|
||||
"link": <EuiLink>
|
||||
Discover
|
||||
</EuiLink>,
|
||||
}
|
||||
}
|
||||
|
@ -290,10 +284,8 @@ exports[`Logs should render normally 1`] = `
|
|||
id="xpack.monitoring.logs.listing.linkText"
|
||||
values={
|
||||
Object {
|
||||
"link": <EuiLink
|
||||
href=""
|
||||
>
|
||||
Logs
|
||||
"link": <EuiLink>
|
||||
Discover
|
||||
</EuiLink>,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { PureComponent } from 'react';
|
||||
import React, { PureComponent, useContext } from 'react';
|
||||
import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app';
|
||||
import { upperFirst } from 'lodash';
|
||||
import { Legacy } from '../../legacy_shims';
|
||||
|
@ -15,7 +15,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { Reason } from './reason';
|
||||
import { useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
import { getLogsLocatorsFromUrlService } from '@kbn/logs-shared-plugin/common';
|
||||
import { ExternalConfigContext } from '../../application/contexts/external_config_context';
|
||||
|
||||
const getFormattedDateTimeLocal = (timestamp) => {
|
||||
const timezone = Legacy.shims.uiSettings?.get('dateFormat:tz');
|
||||
|
@ -111,7 +111,7 @@ const clusterColumns = [
|
|||
},
|
||||
];
|
||||
|
||||
function getLogsUiLink(clusterUuid, nodeId, indexUuid, sharePlugin) {
|
||||
function getLogsUiLink(clusterUuid, nodeId, indexUuid, sharePlugin, logsIndices) {
|
||||
const params = [];
|
||||
if (clusterUuid) {
|
||||
params.push(`elasticsearch.cluster.uuid:${clusterUuid}`);
|
||||
|
@ -124,10 +124,17 @@ function getLogsUiLink(clusterUuid, nodeId, indexUuid, sharePlugin) {
|
|||
}
|
||||
|
||||
const filter = params.join(' and ');
|
||||
const { logsLocator } = getLogsLocatorsFromUrlService(sharePlugin.url);
|
||||
const discoverLocator = sharePlugin.url.locators.get('DISCOVER_APP_LOCATOR');
|
||||
|
||||
const base = logsLocator.getRedirectUrl({
|
||||
filter,
|
||||
const base = discoverLocator.getRedirectUrl({
|
||||
dataViewSpec: {
|
||||
id: logsIndices,
|
||||
title: logsIndices,
|
||||
},
|
||||
query: {
|
||||
language: 'kuery',
|
||||
query: filter,
|
||||
},
|
||||
});
|
||||
|
||||
return base;
|
||||
|
@ -137,7 +144,8 @@ export const Logs = (props) => {
|
|||
const {
|
||||
services: { share },
|
||||
} = useKibana();
|
||||
return <LogsContent sharePlugin={share} {...props} />;
|
||||
const externalConfig = useContext(ExternalConfigContext);
|
||||
return <LogsContent sharePlugin={share} logsIndices={externalConfig.logsIndices} {...props} />;
|
||||
};
|
||||
export class LogsContent extends PureComponent {
|
||||
renderLogs() {
|
||||
|
@ -168,13 +176,15 @@ export class LogsContent extends PureComponent {
|
|||
|
||||
renderCallout() {
|
||||
const { capabilities: uiCapabilities, infra, kibanaServices } = Legacy.shims;
|
||||
const show = uiCapabilities.logs && uiCapabilities.logs.show;
|
||||
const show = uiCapabilities.discover && uiCapabilities.discover.show;
|
||||
|
||||
const {
|
||||
logs: { enabled },
|
||||
nodeId,
|
||||
clusterUuid,
|
||||
indexUuid,
|
||||
sharePlugin,
|
||||
logsIndices,
|
||||
} = this.props;
|
||||
|
||||
if (!enabled || !show) {
|
||||
|
@ -195,9 +205,11 @@ export class LogsContent extends PureComponent {
|
|||
defaultMessage="Visit {link} to dive deeper."
|
||||
values={{
|
||||
link: (
|
||||
<EuiLink href={getLogsUiLink(clusterUuid, nodeId, indexUuid, sharePlugin)}>
|
||||
<EuiLink
|
||||
href={getLogsUiLink(clusterUuid, nodeId, indexUuid, sharePlugin, logsIndices)}
|
||||
>
|
||||
{i18n.translate('xpack.monitoring.logs.listing.calloutLinkText', {
|
||||
defaultMessage: 'Logs',
|
||||
defaultMessage: 'Discover',
|
||||
})}
|
||||
</EuiLink>
|
||||
),
|
||||
|
|
|
@ -10,32 +10,26 @@ import { shallow } from 'enzyme';
|
|||
import { LogsContent } from './logs';
|
||||
import { sharePluginMock } from '@kbn/share-plugin/public/mocks';
|
||||
|
||||
const sharePlugin = sharePluginMock.createStartContract();
|
||||
|
||||
jest.mock('@kbn/logs-shared-plugin/common', () => {
|
||||
return {
|
||||
getLogsLocatorsFromUrlService: jest.fn().mockReturnValue({
|
||||
logsLocator: { getRedirectUrl: jest.fn(() => '') },
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
jest.mock('../../legacy_shims', () => ({
|
||||
Legacy: {
|
||||
shims: {
|
||||
getBasePath: () => '',
|
||||
capabilities: { logs: { show: true } },
|
||||
infra: {
|
||||
locators: {
|
||||
logsLocator: {
|
||||
getRedirectUrl: () => '',
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities: { discover: { show: true } },
|
||||
infra: {},
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
const sharePlugin = {
|
||||
url: {
|
||||
locators: {
|
||||
get: () => {
|
||||
return sharePluginMock.createLocator();
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const logs = {
|
||||
enabled: true,
|
||||
limit: 10,
|
||||
|
@ -134,39 +128,69 @@ const logs = {
|
|||
|
||||
describe('Logs', () => {
|
||||
it('should render normally', () => {
|
||||
const component = shallow(<LogsContent sharePlugin={sharePlugin} logs={logs} />);
|
||||
const component = shallow(
|
||||
<LogsContent sharePlugin={sharePlugin} logsIndices={'logs-*,*:logs-*'} logs={logs} />
|
||||
);
|
||||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should render fewer columns for node or index view', () => {
|
||||
const component = shallow(<LogsContent sharePlugin={sharePlugin} logs={logs} nodeId="12345" />);
|
||||
const component = shallow(
|
||||
<LogsContent
|
||||
sharePlugin={sharePlugin}
|
||||
logsIndices={'logs-*,*:logs-*'}
|
||||
logs={logs}
|
||||
nodeId="12345"
|
||||
/>
|
||||
);
|
||||
expect(component.find('EuiBasicTable').prop('columns')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should render a link to filter by cluster uuid', () => {
|
||||
const component = shallow(
|
||||
<LogsContent sharePlugin={sharePlugin} logs={logs} clusterUuid="12345" />
|
||||
<LogsContent
|
||||
sharePlugin={sharePlugin}
|
||||
logsIndices={'logs-*,*:logs-*'}
|
||||
logs={logs}
|
||||
clusterUuid="12345"
|
||||
/>
|
||||
);
|
||||
expect(component.find('EuiCallOut')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should render a link to filter by cluster uuid and node uuid', () => {
|
||||
const component = shallow(
|
||||
<LogsContent sharePlugin={sharePlugin} logs={logs} clusterUuid="12345" nodeId="6789" />
|
||||
<LogsContent
|
||||
sharePlugin={sharePlugin}
|
||||
logsIndices={'logs-*,*:logs-*'}
|
||||
logs={logs}
|
||||
clusterUuid="12345"
|
||||
nodeId="6789"
|
||||
/>
|
||||
);
|
||||
expect(component.find('EuiCallOut')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should render a link to filter by cluster uuid and index uuid', () => {
|
||||
const component = shallow(
|
||||
<LogsContent sharePlugin={sharePlugin} logs={logs} clusterUuid="12345" indexUuid="6789" />
|
||||
<LogsContent
|
||||
sharePlugin={sharePlugin}
|
||||
logsIndices={'logs-*,*:logs-*'}
|
||||
logs={logs}
|
||||
clusterUuid="12345"
|
||||
indexUuid="6789"
|
||||
/>
|
||||
);
|
||||
expect(component.find('EuiCallOut')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should render a reason if the logs are disabled', () => {
|
||||
const component = shallow(
|
||||
<LogsContent sharePlugin={sharePlugin} logs={{ enabled: false, limit: 15, reason: {} }} />
|
||||
<LogsContent
|
||||
sharePlugin={sharePlugin}
|
||||
logsIndices={'logs-*,*:logs-*'}
|
||||
logs={{ enabled: false, limit: 15, reason: {} }}
|
||||
/>
|
||||
);
|
||||
expect(component).toMatchSnapshot();
|
||||
});
|
||||
|
|
|
@ -19,6 +19,7 @@ import type { HomePublicPluginSetup } from '@kbn/home-plugin/public';
|
|||
import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public';
|
||||
import { TriggersAndActionsUIPublicPluginSetup } from '@kbn/triggers-actions-ui-plugin/public';
|
||||
import {
|
||||
CCS_REMOTE_PATTERN,
|
||||
RULE_DETAILS,
|
||||
RULE_THREAD_POOL_SEARCH_REJECTIONS,
|
||||
RULE_THREAD_POOL_WRITE_REJECTIONS,
|
||||
|
@ -38,6 +39,7 @@ import {
|
|||
MonitoringStartPluginDependencies,
|
||||
LegacyMonitoringStartPluginDependencies,
|
||||
} from './types';
|
||||
import { getIndexPatterns } from '../common/get_index_patterns';
|
||||
|
||||
interface MonitoringSetupPluginDependencies {
|
||||
home?: HomePublicPluginSetup;
|
||||
|
@ -154,6 +156,7 @@ export class MonitoringPlugin
|
|||
monitoring.ui.kibana.reporting.stale_status_threshold_seconds,
|
||||
],
|
||||
['isCcsEnabled', monitoring.ui.ccs.enabled],
|
||||
['logsIndices', getLogsIndices(monitoring)],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -188,3 +191,11 @@ export class MonitoringPlugin
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getLogsIndices = (config: MonitoringConfig) => {
|
||||
return getIndexPatterns({
|
||||
config,
|
||||
type: 'logs',
|
||||
ccs: CCS_REMOTE_PATTERN,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -35,6 +35,7 @@ export const config: PluginConfigDescriptor<TypeOf<typeof configSchema>> = {
|
|||
stale_status_threshold_seconds: true,
|
||||
},
|
||||
},
|
||||
logs: true,
|
||||
},
|
||||
kibana: true,
|
||||
},
|
||||
|
|
|
@ -10,7 +10,7 @@ import { get } from 'lodash';
|
|||
import { isCCSRemoteIndexName } from '@kbn/es-query';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { CCRReadExceptionsStats } from '../../../common/types/alerts';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { AlertCluster, AlertClusterHealth } from '../../../common/types/alerts';
|
|||
import { ElasticsearchSource } from '../../../common/types/es';
|
||||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
|
||||
export async function fetchClusterHealth(
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { ElasticsearchClient } from '@kbn/core/server';
|
||||
import { get } from 'lodash';
|
||||
import { AlertCluster } from '../../../common/types/alerts';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
|
|
|
@ -11,7 +11,7 @@ import moment from 'moment';
|
|||
import { NORMALIZED_DERIVATIVE_UNIT } from '../../../common/constants';
|
||||
import { AlertCluster, AlertCpuUsageNodeStats } from '../../../common/types/alerts';
|
||||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { AlertCluster, AlertDiskUsageNodeStats } from '../../../common/types/ale
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
export async function fetchDiskUsageNodeStats(
|
||||
esClient: ElasticsearchClient,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ElasticsearchSource } from '../../../common/types/es';
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
export async function fetchElasticsearchVersions(
|
||||
esClient: ElasticsearchClient,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { ESGlobPatterns, RegExPatterns } from '../../../common/es_glob_patterns'
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
type TopHitType = ElasticsearchResponseHit & {
|
||||
_source: { index_stats?: Partial<ElasticsearchIndexStats> };
|
||||
|
|
|
@ -10,7 +10,7 @@ import { AlertCluster, AlertVersions } from '../../../common/types/alerts';
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
interface ESAggResponse {
|
||||
key: string;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ElasticsearchSource } from '../../../common/types/es';
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
export async function fetchLicenses(
|
||||
esClient: ElasticsearchClient,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { AlertCluster, AlertVersions } from '../../../common/types/alerts';
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
interface ESAggResponse {
|
||||
key: string;
|
||||
|
|
|
@ -11,7 +11,7 @@ import { AlertCluster, AlertMemoryUsageNodeStats } from '../../../common/types/a
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
export async function fetchMemoryUsageNodeStats(
|
||||
esClient: ElasticsearchClient,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { get } from 'lodash';
|
|||
import { AlertCluster, AlertMissingData } from '../../../common/types/alerts';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
|
||||
interface ClusterBucketESResponse {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ElasticsearchSource } from '../../../common/types/es';
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
function formatNode(
|
||||
nodes: NonNullable<NonNullable<ElasticsearchSource['cluster_state']>['nodes']> | undefined
|
||||
|
|
|
@ -11,7 +11,7 @@ import { AlertCluster, AlertThreadPoolRejectionsStats } from '../../../common/ty
|
|||
import { createDatasetFilter } from './create_dataset_query_filter';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { CCS_REMOTE_PATTERN } from '../../../common/constants';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
const invalidNumberValue = (value: number) => {
|
||||
return isNaN(value) || value === undefined || value === null;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { ApmMetric, ApmMetricFields } from '../metrics';
|
||||
import { createQuery } from '../create_query';
|
||||
import { getBeatDataset } from '../cluster/get_index_patterns';
|
||||
import { getBeatDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
/**
|
||||
* {@code createQuery} for all APM instances.
|
||||
|
|
|
@ -11,7 +11,7 @@ import { ApmMetric } from '../metrics';
|
|||
import { apmAggResponseHandler, apmUuidsAgg, apmAggFilterPath } from './_apm_stats';
|
||||
import { getTimeOfLastEvent } from './_get_time_of_last_event';
|
||||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { getIndexPatterns } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
export function handleResponse(clusterUuid: string, response: ElasticsearchResponse) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { BeatsMetric, BeatsMetricFields } from '../metrics';
|
||||
import { createQuery } from '../create_query';
|
||||
import { getBeatDataset } from '../cluster/get_index_patterns';
|
||||
import { getBeatDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
/**
|
||||
* {@code createQuery} for all Beats instances.
|
||||
|
|
|
@ -10,7 +10,7 @@ import { createBeatsQuery } from './create_beats_query';
|
|||
import { beatsAggFilterPath, beatsUuidsAgg, beatsAggResponseHandler } from './_beats_stats';
|
||||
import type { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { LegacyRequest, Cluster } from '../../types';
|
||||
import { getIndexPatterns } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
export function handleResponse(clusterUuid: string, response: ElasticsearchResponse) {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { TimeRange } from '../../../common/http_api/shared';
|
|||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { Cluster, LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns, getKibanaDataset } from './get_index_patterns';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
export interface FindSupportClusterRequestPayload {
|
||||
timeRange: TimeRange;
|
||||
|
|
|
@ -9,7 +9,7 @@ import { createQuery } from '../create_query';
|
|||
import { ElasticsearchMetric } from '../metrics';
|
||||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from './get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
// is this being used anywhere? not called within the app
|
||||
|
|
|
@ -41,7 +41,7 @@ import { LegacyRequest, Cluster } from '../../types';
|
|||
import { RulesByType } from '../../../common/types/alerts';
|
||||
import { getClusterRuleDataForClusters, getInstanceRuleDataForClusters } from '../kibana/rules';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { getIndexPatterns } from './get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
|
||||
/**
|
||||
* Get all clusters or the cluster associated with {@code clusterUuid} when it is defined.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { find } from 'lodash';
|
||||
import { ElasticsearchResponse, ElasticsearchModifiedSource } from '../../../common/types/es';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns } from './get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,7 @@ import { parseCrossClusterPrefix } from '../../../common/ccs_utils';
|
|||
import { getClustersState } from './get_clusters_state';
|
||||
import { ElasticsearchResponse, ElasticsearchModifiedSource } from '../../../common/types/es';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from './get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,7 @@ import {
|
|||
DS_INDEX_PATTERN_METRICS,
|
||||
} from '../../../common/constants';
|
||||
import { formatUTCTimestampForTimezone } from '../format_timezone';
|
||||
import { getIndexPatterns } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
import type { Metric } from '../metrics/metrics';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ElasticsearchMetric } from '../metrics';
|
|||
import { createQuery } from '../create_query';
|
||||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
export async function checkCcrEnabled(req: LegacyRequest, ccs: string) {
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
ElasticsearchResponseHit,
|
||||
} from '../../../common/types/es';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,7 @@ import { ElasticsearchMetric } from '../metrics';
|
|||
import { ML_SUPPORTED_LICENSES } from '../../../common/constants';
|
||||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { LegacyRequest, Cluster } from '../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
/*
|
||||
|
|
|
@ -11,7 +11,7 @@ import { createQuery } from '../../create_query';
|
|||
import { ElasticsearchMetric } from '../../metrics';
|
||||
import { ElasticsearchResponse } from '../../../../common/types/es';
|
||||
import { LegacyRequest } from '../../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../static_globals';
|
||||
|
||||
export function handleResponse(shardStats: any, indexUuid: string) {
|
||||
|
|
|
@ -13,7 +13,7 @@ import { calculateRate } from '../../calculate_rate';
|
|||
import { getUnassignedShards } from '../shards';
|
||||
import { ElasticsearchResponse } from '../../../../common/types/es';
|
||||
import { LegacyRequest } from '../../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../static_globals';
|
||||
|
||||
export function handleResponse(
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
ElasticsearchLegacySource,
|
||||
} from '../../../../common/types/es';
|
||||
import { LegacyRequest } from '../../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../static_globals';
|
||||
|
||||
export function handleResponse(
|
||||
|
|
|
@ -10,7 +10,10 @@ import { get } from 'lodash';
|
|||
import { ElasticsearchMetric } from '../../../metrics';
|
||||
import { createQuery } from '../../../create_query';
|
||||
import { LegacyRequest, Bucket } from '../../../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../cluster/get_index_patterns';
|
||||
import {
|
||||
getIndexPatterns,
|
||||
getElasticsearchDataset,
|
||||
} from '../../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../../static_globals';
|
||||
|
||||
export async function getNodeIds(
|
||||
|
|
|
@ -14,7 +14,10 @@ import { handleResponse } from './handle_response';
|
|||
import { LISTING_METRICS_NAMES, LISTING_METRICS_PATHS } from './nodes_listing_metrics';
|
||||
import { LegacyRequest } from '../../../../types';
|
||||
import { ElasticsearchModifiedSource } from '../../../../../common/types/es';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../cluster/get_index_patterns';
|
||||
import {
|
||||
getIndexPatterns,
|
||||
getElasticsearchDataset,
|
||||
} from '../../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../../static_globals';
|
||||
|
||||
/* Run an aggregation on node_stats to get stat data for the selected time
|
||||
|
|
|
@ -11,7 +11,7 @@ import { ElasticsearchMetric } from '../../metrics';
|
|||
import { calculateIndicesTotals } from './calculate_shard_stat_indices_totals';
|
||||
import { LegacyRequest } from '../../../types';
|
||||
import { ElasticsearchModifiedSource } from '../../../../common/types/es';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../static_globals';
|
||||
|
||||
async function getUnassignedShardData(req: LegacyRequest, cluster: ElasticsearchModifiedSource) {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { createQuery } from '../../create_query';
|
|||
import { ElasticsearchMetric } from '../../metrics';
|
||||
import { LegacyRequest } from '../../../types';
|
||||
import { ElasticsearchModifiedSource } from '../../../../common/types/es';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../static_globals';
|
||||
|
||||
async function getShardCountPerNode(req: LegacyRequest, cluster: ElasticsearchModifiedSource) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { createQuery } from '../../create_query';
|
|||
import { ElasticsearchMetric } from '../../metrics';
|
||||
import { ElasticsearchResponse, ElasticsearchLegacySource } from '../../../../common/types/es';
|
||||
import { LegacyRequest } from '../../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../static_globals';
|
||||
|
||||
export function handleResponse(response: ElasticsearchResponse) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { get } from 'lodash';
|
|||
import { ElasticsearchModifiedSource, ElasticsearchResponse } from '../../../../common/types/es';
|
||||
import { Globals } from '../../../static_globals';
|
||||
import { LegacyRequest } from '../../../types';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getElasticsearchDataset } from '../../../../common/get_index_patterns';
|
||||
import { createQuery } from '../../create_query';
|
||||
import { ElasticsearchMetric } from '../../metrics';
|
||||
import { calculateIndicesTotals } from './calculate_shard_stat_indices_totals';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { EnterpriseSearchMetric, EnterpriseSearchMetricFields } from '../metrics';
|
||||
import { createQuery } from '../create_query';
|
||||
import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../common/constants';
|
||||
import { getEntsearchDataset } from '../cluster/get_index_patterns';
|
||||
import { getEntsearchDataset } from '../../../common/get_index_patterns';
|
||||
|
||||
/**
|
||||
* {@code createQuery} for all Enterprise Search instances.
|
||||
|
|
|
@ -9,7 +9,7 @@ import { TimeRange } from '../../../common/http_api/shared';
|
|||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { Cluster, LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
import { EnterpriseSearchMetric } from '../metrics';
|
||||
import { createEnterpriseSearchQuery } from './create_enterprise_search_query';
|
||||
import {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { TimeRange } from '../../../common/http_api/shared';
|
|||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
import { createEnterpriseSearchQuery } from './create_enterprise_search_query';
|
||||
import {
|
||||
entSearchAggFilterPath,
|
||||
|
|
|
@ -9,7 +9,7 @@ import { merge } from 'lodash';
|
|||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../../common/get_index_patterns';
|
||||
import { MissingRequiredError } from '../error_missing_required';
|
||||
import { buildKibanaInfo } from './build_kibana_info';
|
||||
import { isKibanaStatusStale } from './is_kibana_status_stale';
|
||||
|
|
|
@ -9,7 +9,7 @@ import moment from 'moment';
|
|||
import { ElasticsearchResponse, ElasticsearchResponseHit } from '../../../common/types/es';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../../common/get_index_patterns';
|
||||
import { createQuery } from '../create_query';
|
||||
import { KibanaMetric } from '../metrics';
|
||||
import { buildKibanaInfo, KibanaInfo } from './build_kibana_info';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { chain, find } from 'lodash';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { Bucket, Cluster, LegacyRequest } from '../../types';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../../common/get_index_patterns';
|
||||
import { createQuery } from '../create_query';
|
||||
import { KibanaClusterMetric } from '../metrics';
|
||||
import { isKibanaStatusStale } from './is_kibana_status_stale';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { Cluster, LegacyRequest } from '../../../types';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../static_globals';
|
||||
import { createQuery } from '../../create_query';
|
||||
import { KibanaClusterRuleMetric } from '../../metrics';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { Cluster, LegacyRequest } from '../../../types';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getKibanaDataset } from '../../../../common/get_index_patterns';
|
||||
import { Globals } from '../../../static_globals';
|
||||
import { createQuery } from '../../create_query';
|
||||
import { KibanaClusterRuleMetric } from '../../metrics';
|
||||
|
|
|
@ -1,29 +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
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { LogsSharedPluginSetup } from '@kbn/logs-shared-plugin/server';
|
||||
import { CCS_REMOTE_PATTERN, INFRA_SOURCE_ID } from '../../../common/constants';
|
||||
import { MonitoringConfig } from '../../config';
|
||||
import { getIndexPatterns } from '../cluster/get_index_patterns';
|
||||
|
||||
export const initLogView = (config: MonitoringConfig, logsShared: LogsSharedPluginSetup) => {
|
||||
if (logsShared) {
|
||||
const logsIndexPattern = getIndexPatterns({
|
||||
config,
|
||||
type: 'logs',
|
||||
ccs: CCS_REMOTE_PATTERN,
|
||||
});
|
||||
|
||||
logsShared.logViews.defineInternalLogView(INFRA_SOURCE_ID, {
|
||||
name: 'Elastic Stack Logs',
|
||||
logIndices: {
|
||||
type: 'index_name',
|
||||
indexName: logsIndexPattern,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
|
@ -10,7 +10,7 @@ import { LegacyRequest, Cluster, Bucket } from '../../types';
|
|||
import { LOGSTASH } from '../../../common/constants';
|
||||
import { createQuery } from '../create_query';
|
||||
import { LogstashClusterMetric } from '../metrics';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
const { MEMORY, PERSISTED } = LOGSTASH.QUEUE_TYPES;
|
||||
|
|
|
@ -12,7 +12,7 @@ import { LegacyRequest } from '../../types';
|
|||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../common/constants';
|
||||
import { standaloneClusterFilter } from '../standalone_clusters/standalone_cluster_query_filter';
|
||||
import { getIndexPatterns } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
export function handleResponse(resp: ElasticsearchResponse) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { calculateAvailability } from '../calculate_availability';
|
|||
import { LogstashMetric } from '../metrics';
|
||||
import { LegacyRequest } from '../../types';
|
||||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
interface Logstash {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { getLogstashPipelineIds } from './get_pipeline_ids';
|
|||
import { sortPipelines } from './sort_pipelines';
|
||||
import { paginate } from '../pagination/paginate';
|
||||
import { getMetrics } from '../details/get_metrics';
|
||||
import { getLogstashDataset } from '../cluster/get_index_patterns';
|
||||
import { getLogstashDataset } from '../../../common/get_index_patterns';
|
||||
import {
|
||||
LegacyRequest,
|
||||
Pipeline,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { get } from 'lodash';
|
|||
import { LegacyRequest, Bucket, Pipeline } from '../../types';
|
||||
import { createQuery } from '../create_query';
|
||||
import { LogstashMetric } from '../metrics';
|
||||
import { getIndexPatterns } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
interface GetLogstashPipelineIdsParams {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { createQuery } from '../create_query';
|
|||
import { LogstashMetric } from '../metrics';
|
||||
import { LegacyRequest, PipelineVersion } from '../../types';
|
||||
import { ElasticsearchResponse } from '../../../common/types/es';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
||||
export async function getPipelineStateDocument({
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
PostLogstashPipelineRequestPayload,
|
||||
} from '../../../common/http_api/logstash';
|
||||
import { LegacyRequest, PipelineVersion } from '../../types';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../../../common/get_index_patterns';
|
||||
import { createQuery } from '../create_query';
|
||||
import { LogstashMetric } from '../metrics';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { get, orderBy } from 'lodash';
|
||||
import { createQuery } from '../create_query';
|
||||
import { LogstashMetric } from '../metrics';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../../../common/get_index_patterns';
|
||||
import { Globals } from '../../static_globals';
|
||||
import { LegacyRequest, PipelineVersion } from '../../types';
|
||||
import { mergePipelineVersions } from './merge_pipeline_versions';
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
PostLogstashPipelineRequestPayload,
|
||||
} from '../../../common/http_api/logstash';
|
||||
import { LegacyRequest, PipelineVersion } from '../../types';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getLogstashDataset } from '../../../common/get_index_patterns';
|
||||
import { createQuery } from '../create_query';
|
||||
import { LogstashMetric } from '../metrics';
|
||||
import { Globals } from '../../static_globals';
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
import { featuresPluginMock } from '@kbn/features-plugin/server/mocks';
|
||||
import { infraPluginMock } from '@kbn/infra-plugin/server/mocks';
|
||||
import { logsSharedPluginMock } from '@kbn/logs-shared-plugin/server/mocks';
|
||||
import { loggerMock } from '@kbn/logging-mocks';
|
||||
import { usageCollectionPluginMock } from '@kbn/usage-collection-plugin/server/mocks';
|
||||
import { configSchema, createConfig } from '../../../config';
|
||||
|
@ -39,7 +38,6 @@ const mockReq = (
|
|||
usageCollection: usageCollectionSetup,
|
||||
features: featuresPluginMock.createSetup(),
|
||||
infra: infraPluginMock.createSetupContract(),
|
||||
logsShared: logsSharedPluginMock.createSetupContract(),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
} from '../../../../common/constants';
|
||||
import { TimeRange } from '../../../../common/http_api/shared';
|
||||
import { LegacyRequest } from '../../../types';
|
||||
import { getLegacyIndexPattern } from '../../cluster/get_index_patterns';
|
||||
import { getLegacyIndexPattern } from '../../../../common/get_index_patterns';
|
||||
import { getLivesNodes } from '../../elasticsearch/nodes/get_nodes/get_live_nodes';
|
||||
|
||||
interface Bucket {
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
getIndexPatterns,
|
||||
getLogstashDataset,
|
||||
getBeatDataset,
|
||||
} from '../cluster/get_index_patterns';
|
||||
} from '../../../common/get_index_patterns';
|
||||
|
||||
export async function hasStandaloneClusters(req: LegacyRequest, ccs: string) {
|
||||
const lsIndexPatterns = getIndexPatterns({
|
||||
|
|
|
@ -36,7 +36,6 @@ import { configSchema, createConfig, MonitoringConfig } from './config';
|
|||
import { instantiateClient } from './es_client/instantiate_client';
|
||||
import { initBulkUploader } from './kibana_monitoring';
|
||||
import { registerCollectors } from './kibana_monitoring/collectors';
|
||||
import { initLogView } from './lib/logs/init_log_view';
|
||||
import { LicenseService } from './license_service';
|
||||
import { requireUIRoutes } from './routes';
|
||||
import { EndpointTypes, Globals } from './static_globals';
|
||||
|
@ -203,7 +202,6 @@ export class MonitoringPlugin
|
|||
alerting: plugins.alerting,
|
||||
logger: this.log,
|
||||
});
|
||||
initLogView(config, plugins.logsShared);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import type { LegacyRequest, MonitoringCore } from '../../../../types';
|
||||
import type { MonitoringConfig } from '../../../../config';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getIndexPatterns, getDsIndexPattern } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns, getDsIndexPattern } from '../../../../../common/get_index_patterns';
|
||||
import { getHealthRequestQueryRT } from '../../../../../common/http_api/_health';
|
||||
import type { TimeRange } from '../../../../../common/http_api/shared';
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
getKibanaDataset,
|
||||
getLogstashDataset,
|
||||
getEntsearchDataset,
|
||||
} from '../../../../../lib/cluster/get_index_patterns';
|
||||
} from '../../../../../../common/get_index_patterns';
|
||||
|
||||
const MAX_BUCKET_SIZE = 100;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import { getApmInfo } from '../../../../lib/apm';
|
|||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getMetrics } from '../../../../lib/details/get_metrics';
|
||||
import { handleError } from '../../../../lib/errors';
|
||||
import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../../../common/get_index_patterns';
|
||||
import { MonitoringCore } from '../../../../types';
|
||||
import { metricSet } from './metric_set_instance';
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
import { getApms, getStats } from '../../../../lib/apm';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { handleError } from '../../../../lib/errors';
|
||||
import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../../../common/get_index_patterns';
|
||||
import { MonitoringCore } from '../../../../types';
|
||||
|
||||
export function apmInstancesRoute(server: MonitoringCore) {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { getBeatSummary } from '../../../../lib/beats';
|
|||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getMetrics } from '../../../../lib/details/get_metrics';
|
||||
import { handleError } from '../../../../lib/errors';
|
||||
import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../../../common/get_index_patterns';
|
||||
import { MonitoringCore } from '../../../../types';
|
||||
import { metricSet } from './metric_set_detail';
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
import { getBeats, getStats } from '../../../../lib/beats';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { handleError } from '../../../../lib/errors';
|
||||
import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../../../common/get_index_patterns';
|
||||
import { MonitoringCore } from '../../../../types';
|
||||
|
||||
export function beatsListingRoute(server: MonitoringCore) {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { getLatestStats, getStats } from '../../../../lib/beats';
|
|||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getMetrics } from '../../../../lib/details/get_metrics';
|
||||
import { handleError } from '../../../../lib/errors';
|
||||
import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../../../common/get_index_patterns';
|
||||
import { MonitoringCore } from '../../../../types';
|
||||
import { metricSet } from './metric_set_overview';
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { get, groupBy } from 'lodash';
|
|||
import {
|
||||
getIndexPatterns,
|
||||
getElasticsearchDataset,
|
||||
} from '../../../../lib/cluster/get_index_patterns';
|
||||
} from '../../../../../common/get_index_patterns';
|
||||
import {
|
||||
postElasticsearchCcrRequestParamsRT,
|
||||
postElasticsearchCcrRequestPayloadRT,
|
||||
|
|
|
@ -15,7 +15,7 @@ import { ElasticsearchResponse } from '../../../../../common/types/es';
|
|||
import {
|
||||
getIndexPatterns,
|
||||
getElasticsearchDataset,
|
||||
} from '../../../../lib/cluster/get_index_patterns';
|
||||
} from '../../../../../common/get_index_patterns';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getMetrics } from '../../../../lib/details/get_metrics';
|
||||
import { handleError } from '../../../../lib/errors/handle_error';
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
postElasticsearchIndexDetailResponsePayloadRT,
|
||||
} from '../../../../../common/http_api/elasticsearch';
|
||||
import { getClusterStats } from '../../../../lib/cluster/get_cluster_stats';
|
||||
import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../../../common/get_index_patterns';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getMetrics } from '../../../../lib/details/get_metrics';
|
||||
import { getIndexSummary } from '../../../../lib/elasticsearch/indices';
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
postElasticsearchNodeDetailResponsePayloadRT,
|
||||
} from '../../../../../common/http_api/elasticsearch';
|
||||
import { getClusterStats } from '../../../../lib/cluster/get_cluster_stats';
|
||||
import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../../../common/get_index_patterns';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import {
|
||||
getMetrics,
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
} from '../../../../../common/http_api/elasticsearch';
|
||||
import { getClusterStats } from '../../../../lib/cluster/get_cluster_stats';
|
||||
import { getClusterStatus } from '../../../../lib/cluster/get_cluster_status';
|
||||
import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getIndexPatterns } from '../../../../../common/get_index_patterns';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getMetrics } from '../../../../lib/details/get_metrics';
|
||||
import { getLastRecovery } from '../../../../lib/elasticsearch/get_last_recovery';
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
} from '../../../../../common/http_api/kibana';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { MonitoringCore } from '../../../../types';
|
||||
import { getKibanaDataset } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getKibanaDataset } from '../../../../../common/get_index_patterns';
|
||||
|
||||
export function kibanaOverviewRoute(server: MonitoringCore) {
|
||||
const validateParams = createValidationFunction(postKibanaOverviewRequestParamsRT);
|
||||
|
|
|
@ -19,7 +19,7 @@ import {
|
|||
import { metricSets } from './metric_set_node';
|
||||
import { MonitoringCore } from '../../../../types';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getLogstashDataset } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getLogstashDataset } from '../../../../../common/get_index_patterns';
|
||||
|
||||
const { advanced: metricSetAdvanced, overview: metricSetOverview } = metricSets;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import { handleError } from '../../../../lib/errors';
|
|||
import { metricSet } from './metric_set_overview';
|
||||
import { MonitoringCore } from '../../../../types';
|
||||
import { createValidationFunction } from '../../../../lib/create_route_validation_function';
|
||||
import { getLogstashDataset } from '../../../../lib/cluster/get_index_patterns';
|
||||
import { getLogstashDataset } from '../../../../../common/get_index_patterns';
|
||||
|
||||
export function logstashOverviewRoute(server: MonitoringCore) {
|
||||
const validateParams = createValidationFunction(postLogstashOverviewRequestParamsRT);
|
||||
|
|
|
@ -35,7 +35,6 @@ import { FeaturesPluginSetup } from '@kbn/features-plugin/server';
|
|||
import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server';
|
||||
import { CloudSetup } from '@kbn/cloud-plugin/server';
|
||||
import { RouteConfig, RouteMethod, Headers } from '@kbn/core/server';
|
||||
import { LogsSharedPluginSetup } from '@kbn/logs-shared-plugin/server';
|
||||
import { ElasticsearchModifiedSource } from '../common/types/es';
|
||||
import { RulesByType } from '../common/types/alerts';
|
||||
import { configSchema, MonitoringConfig } from './config';
|
||||
|
@ -57,7 +56,6 @@ export interface PluginsSetup {
|
|||
alerting?: AlertingPluginSetupContract;
|
||||
infra: InfraPluginSetup;
|
||||
cloud?: CloudSetup;
|
||||
logsShared: LogsSharedPluginSetup;
|
||||
}
|
||||
|
||||
export type RequestHandlerContextMonitoringPlugin = CustomRequestHandlerContext<{
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
"@kbn/shared-ux-router",
|
||||
"@kbn/observability-shared-plugin",
|
||||
"@kbn/shared-ux-link-redirect-app",
|
||||
"@kbn/logs-shared-plugin",
|
||||
"@kbn/alerts-as-data-utils",
|
||||
"@kbn/rule-data-utils",
|
||||
"@kbn/react-kibana-mount",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue