mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[apm][infra] remove infra dependency from apm (#167531)
## Summary Closes https://github.com/elastic/kibana/issues/166834 Moves the following components out of infra plugin so we can remove the apm->infra dependency - `/infra/metrics_explorer` route - (Host|Pod|Container)MetricsTable components - InfraAppId - InfraLocators ### Testing We should focus the testing on the metrics_explorer route which is used by 1. Tables in the Infrastructure section of apm and 2. Infrastructure > Metrics explorer app. No functionality was added so these apps should have the same existing behavior. Easiest way to get these views loaded is by connecting kibana to an edge-oblt cluster, alternatively load service and metrics with a data loader. ### Follow up - (Host|Pod|Container)MetricsTable components are part of the metricsDataAccess plugin contract but should be moved to stateless package --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Jason Rhodes <jason.rhodes@elastic.co>
This commit is contained in:
parent
99a0adf0f7
commit
f1fa4b0b98
382 changed files with 7788 additions and 752 deletions
|
@ -94,6 +94,7 @@ pageLoadAssetSize:
|
|||
management: 46112
|
||||
maps: 90000
|
||||
mapsEms: 26072
|
||||
metricsDataAccess: 60000
|
||||
ml: 82187
|
||||
monitoring: 80000
|
||||
navigation: 37269
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
"xpack.logstash": ["plugins/logstash"],
|
||||
"xpack.main": "legacy/plugins/xpack_main",
|
||||
"xpack.maps": ["plugins/maps"],
|
||||
"xpack.metricsData": "plugins/metrics_data_access",
|
||||
"xpack.ml": [
|
||||
"packages/ml/anomaly_utils",
|
||||
"packages/ml/data_grid",
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
"discover",
|
||||
"fleet",
|
||||
"fieldFormats",
|
||||
"infra",
|
||||
"home",
|
||||
"ml",
|
||||
"security",
|
||||
|
|
|
@ -49,7 +49,6 @@ export const renderApp = ({
|
|||
plugins: pluginsSetup,
|
||||
data: pluginsStart.data,
|
||||
inspector: pluginsStart.inspector,
|
||||
infra: pluginsStart.infra,
|
||||
observability: pluginsStart.observability,
|
||||
observabilityShared: pluginsStart.observabilityShared,
|
||||
observabilityRuleTypeRegistry,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { CoreStart } from '@kbn/core/public';
|
|||
import { shallow } from 'enzyme';
|
||||
|
||||
const KibanaReactContext = createKibanaReactContext({
|
||||
infra: {
|
||||
metricsDataAccess: {
|
||||
HostMetricsTable: () => 'Host metrics table',
|
||||
ContainerMetricsTable: () => 'Container metrics table',
|
||||
PodMetricsTable: () => 'Pods metrics table',
|
||||
|
|
|
@ -42,10 +42,10 @@ export function useTabs({
|
|||
end: string;
|
||||
}) {
|
||||
const { services } = useKibana<ApmPluginStartDeps>();
|
||||
const { infra } = services;
|
||||
const HostMetricsTable = infra?.HostMetricsTable;
|
||||
const ContainerMetricsTable = infra?.ContainerMetricsTable;
|
||||
const PodMetricsTable = infra?.PodMetricsTable;
|
||||
const { metricsDataAccess } = services;
|
||||
const HostMetricsTable = metricsDataAccess?.HostMetricsTable;
|
||||
const ContainerMetricsTable = metricsDataAccess?.ContainerMetricsTable;
|
||||
const PodMetricsTable = metricsDataAccess?.PodMetricsTable;
|
||||
|
||||
const timerange = useMemo(
|
||||
() => ({
|
||||
|
@ -91,7 +91,10 @@ export function useTabs({
|
|||
<>
|
||||
<EuiSpacer />
|
||||
{ContainerMetricsTable &&
|
||||
ContainerMetricsTable({ timerange, filterClauseDsl: containersFilter })}
|
||||
ContainerMetricsTable({
|
||||
timerange,
|
||||
filterClauseDsl: containersFilter,
|
||||
})}
|
||||
</>
|
||||
);
|
||||
|
||||
|
@ -99,7 +102,10 @@ export function useTabs({
|
|||
<>
|
||||
<EuiSpacer />
|
||||
{PodMetricsTable &&
|
||||
PodMetricsTable({ timerange, filterClauseDsl: podsFilter })}
|
||||
PodMetricsTable({
|
||||
timerange,
|
||||
filterClauseDsl: podsFilter,
|
||||
})}
|
||||
</>
|
||||
);
|
||||
|
||||
|
@ -107,7 +113,10 @@ export function useTabs({
|
|||
<>
|
||||
<EuiSpacer />
|
||||
{HostMetricsTable &&
|
||||
HostMetricsTable({ timerange, filterClauseDsl: hostsFilter })}
|
||||
HostMetricsTable({
|
||||
timerange,
|
||||
filterClauseDsl: hostsFilter,
|
||||
})}
|
||||
</>
|
||||
);
|
||||
|
||||
|
|
|
@ -19,6 +19,10 @@ import {
|
|||
AllDatasetsLocatorParams,
|
||||
ALL_DATASETS_LOCATOR_ID,
|
||||
} from '@kbn/deeplinks-observability/locators';
|
||||
import {
|
||||
NODE_LOGS_LOCATOR_ID,
|
||||
NodeLogsLocatorParams,
|
||||
} from '@kbn/logs-shared-plugin/common';
|
||||
import { isJavaAgentName } from '../../../../../../common/agent_name';
|
||||
import { SERVICE_NODE_NAME } from '../../../../../../common/es_fields/apm';
|
||||
import { useApmPluginContext } from '../../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
|
@ -44,7 +48,7 @@ export function InstanceActionsMenu({
|
|||
kuery,
|
||||
onClose,
|
||||
}: Props) {
|
||||
const { core, infra, share } = useApmPluginContext();
|
||||
const { core, share } = useApmPluginContext();
|
||||
const { data, status } = useInstanceDetailsFetcher({
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
@ -59,6 +63,8 @@ export function InstanceActionsMenu({
|
|||
const allDatasetsLocator = share.url.locators.get<AllDatasetsLocatorParams>(
|
||||
ALL_DATASETS_LOCATOR_ID
|
||||
)!;
|
||||
const nodeLogsLocator =
|
||||
share.url.locators.get<NodeLogsLocatorParams>(NODE_LOGS_LOCATOR_ID)!;
|
||||
|
||||
if (isPending(status)) {
|
||||
return (
|
||||
|
@ -97,8 +103,8 @@ export function InstanceActionsMenu({
|
|||
basePath: core.http.basePath,
|
||||
onFilterByInstanceClick: handleFilterByInstanceClick,
|
||||
metricsHref,
|
||||
infraLocators: infra?.locators,
|
||||
allDatasetsLocator,
|
||||
nodeLogsLocator,
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { IBasePath } from '@kbn/core/public';
|
||||
import moment from 'moment';
|
||||
import type { InfraLocators } from '@kbn/infra-plugin/common/locators';
|
||||
import type { LocatorPublic } from '@kbn/share-plugin/public';
|
||||
import { AllDatasetsLocatorParams } from '@kbn/deeplinks-observability/locators';
|
||||
import { NodeLogsLocatorParams } from '@kbn/logs-shared-plugin/common';
|
||||
import { getNodeLogsHref } from '../../../../shared/links/observability_logs_link';
|
||||
import { APIReturnType } from '../../../../../services/rest/create_call_apm_api';
|
||||
import { getInfraHref } from '../../../../shared/links/infra_link';
|
||||
|
@ -41,15 +41,15 @@ export function getMenuSections({
|
|||
basePath,
|
||||
onFilterByInstanceClick,
|
||||
metricsHref,
|
||||
infraLocators,
|
||||
allDatasetsLocator,
|
||||
nodeLogsLocator,
|
||||
}: {
|
||||
instanceDetails: InstaceDetails;
|
||||
basePath: IBasePath;
|
||||
onFilterByInstanceClick: () => void;
|
||||
metricsHref: string;
|
||||
infraLocators?: InfraLocators;
|
||||
allDatasetsLocator: LocatorPublic<AllDatasetsLocatorParams>;
|
||||
nodeLogsLocator: LocatorPublic<NodeLogsLocatorParams>;
|
||||
}) {
|
||||
const podId = instanceDetails.kubernetes?.pod?.uid;
|
||||
const containerId = instanceDetails.container?.id;
|
||||
|
@ -57,21 +57,20 @@ export function getMenuSections({
|
|||
? new Date(instanceDetails['@timestamp']).valueOf()
|
||||
: undefined;
|
||||
const infraMetricsQuery = getInfraMetricsQuery(instanceDetails['@timestamp']);
|
||||
const infraNodeLocator = infraLocators?.nodeLogsLocator;
|
||||
|
||||
const podLogsHref = getNodeLogsHref(
|
||||
'pod',
|
||||
podId!,
|
||||
time,
|
||||
allDatasetsLocator,
|
||||
infraNodeLocator
|
||||
nodeLogsLocator
|
||||
);
|
||||
const containerLogsHref = getNodeLogsHref(
|
||||
'container',
|
||||
containerId!,
|
||||
time,
|
||||
allDatasetsLocator,
|
||||
infraNodeLocator
|
||||
nodeLogsLocator
|
||||
);
|
||||
|
||||
const podActions: Action[] = [
|
||||
|
@ -96,7 +95,7 @@ export function getMenuSections({
|
|||
path: `/link-to/pod-detail/${podId}`,
|
||||
query: infraMetricsQuery,
|
||||
}),
|
||||
condition: !!podId && !!infraLocators,
|
||||
condition: !!podId,
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -122,7 +121,7 @@ export function getMenuSections({
|
|||
path: `/link-to/container-detail/${containerId}`,
|
||||
query: infraMetricsQuery,
|
||||
}),
|
||||
condition: !!containerId && !!infraLocators,
|
||||
condition: !!containerId,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { EuiLink, EuiLinkAnchorProps } from '@elastic/eui';
|
|||
import { IBasePath } from '@kbn/core/public';
|
||||
import React from 'react';
|
||||
import url from 'url';
|
||||
import { InfraAppId } from '@kbn/infra-plugin/public';
|
||||
import { InfraAppId } from '@kbn/observability-shared-plugin/public/infra';
|
||||
import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { fromQuery } from './url_helpers';
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
*/
|
||||
|
||||
import type {
|
||||
NodeLogsLocator,
|
||||
LogsLocator,
|
||||
} from '@kbn/infra-plugin/common/locators';
|
||||
LogsLocatorParams,
|
||||
NodeLogsLocatorParams,
|
||||
} from '@kbn/logs-shared-plugin/common';
|
||||
import { AllDatasetsLocatorParams } from '@kbn/deeplinks-observability/locators';
|
||||
import { LocatorPublic } from '@kbn/share-plugin/common';
|
||||
import moment from 'moment';
|
||||
|
@ -27,7 +27,7 @@ export const getNodeLogsHref = (
|
|||
id: string,
|
||||
time: number | undefined,
|
||||
allDatasetsLocator: LocatorPublic<AllDatasetsLocatorParams>,
|
||||
infraNodeLocator?: NodeLogsLocator
|
||||
infraNodeLocator?: LocatorPublic<NodeLogsLocatorParams>
|
||||
): string => {
|
||||
if (infraNodeLocator)
|
||||
return infraNodeLocator?.getRedirectUrl({
|
||||
|
@ -53,7 +53,7 @@ export const getTraceLogsHref = (
|
|||
traceId: string,
|
||||
time: number | undefined,
|
||||
allDatasetsLocator: LocatorPublic<AllDatasetsLocatorParams>,
|
||||
infraLogsLocator?: LogsLocator
|
||||
infraLogsLocator: LocatorPublic<LogsLocatorParams>
|
||||
): string => {
|
||||
const query = `trace.id:"${traceId}" OR (not trace.id:* AND "${traceId}")`;
|
||||
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { IBasePath } from '@kbn/core/public';
|
||||
import { LocatorPublic } from '@kbn/share-plugin/common';
|
||||
import {
|
||||
LogsLocatorParams,
|
||||
NodeLogsLocatorParams,
|
||||
} from '@kbn/logs-shared-plugin/common';
|
||||
import { Transaction } from '../../../../typings/es_schemas/ui/transaction';
|
||||
import { getSections } from './sections';
|
||||
import {
|
||||
|
@ -24,12 +29,12 @@ const apmRouter = {
|
|||
`some-basepath/app/apm${apmRouterBase.link(...args)}`,
|
||||
} as ApmRouter;
|
||||
|
||||
const infraLocators = infraLocatorsMock;
|
||||
const { allDatasetsLocator } = observabilityLogExplorerLocatorsMock;
|
||||
const { nodeLogsLocator, logsLocator } = infraLocatorsMock;
|
||||
|
||||
const expectInfraLocatorsToBeCalled = () => {
|
||||
expect(infraLocators.nodeLogsLocator.getRedirectUrl).toBeCalledTimes(3);
|
||||
expect(infraLocators.logsLocator.getRedirectUrl).toBeCalledTimes(1);
|
||||
expect(nodeLogsLocator.getRedirectUrl).toBeCalledTimes(3);
|
||||
expect(logsLocator.getRedirectUrl).toBeCalledTimes(1);
|
||||
};
|
||||
|
||||
describe('Transaction action menu', () => {
|
||||
|
@ -64,8 +69,10 @@ describe('Transaction action menu', () => {
|
|||
basePath,
|
||||
location,
|
||||
apmRouter,
|
||||
infraLocators,
|
||||
allDatasetsLocator,
|
||||
logsLocator: logsLocator as unknown as LocatorPublic<LogsLocatorParams>,
|
||||
nodeLogsLocator:
|
||||
nodeLogsLocator as unknown as LocatorPublic<NodeLogsLocatorParams>,
|
||||
infraLinksAvailable: false,
|
||||
rangeFrom: 'now-24h',
|
||||
rangeTo: 'now',
|
||||
|
@ -130,7 +137,9 @@ describe('Transaction action menu', () => {
|
|||
basePath,
|
||||
location,
|
||||
apmRouter,
|
||||
infraLocators,
|
||||
logsLocator: logsLocator as unknown as LocatorPublic<LogsLocatorParams>,
|
||||
nodeLogsLocator:
|
||||
nodeLogsLocator as unknown as LocatorPublic<NodeLogsLocatorParams>,
|
||||
allDatasetsLocator,
|
||||
infraLinksAvailable: true,
|
||||
rangeFrom: 'now-24h',
|
||||
|
@ -215,7 +224,9 @@ describe('Transaction action menu', () => {
|
|||
basePath,
|
||||
location,
|
||||
apmRouter,
|
||||
infraLocators,
|
||||
logsLocator: logsLocator as unknown as LocatorPublic<LogsLocatorParams>,
|
||||
nodeLogsLocator:
|
||||
nodeLogsLocator as unknown as LocatorPublic<NodeLogsLocatorParams>,
|
||||
allDatasetsLocator,
|
||||
infraLinksAvailable: true,
|
||||
rangeFrom: 'now-24h',
|
||||
|
|
|
@ -11,7 +11,10 @@ import { IBasePath } from '@kbn/core/public';
|
|||
import { isEmpty, pickBy } from 'lodash';
|
||||
import moment from 'moment';
|
||||
import url from 'url';
|
||||
import type { InfraLocators } from '@kbn/infra-plugin/common/locators';
|
||||
import {
|
||||
LogsLocatorParams,
|
||||
NodeLogsLocatorParams,
|
||||
} from '@kbn/logs-shared-plugin/common';
|
||||
import { LocatorPublic } from '@kbn/share-plugin/common';
|
||||
import { AllDatasetsLocatorParams } from '@kbn/deeplinks-observability/locators';
|
||||
import type { ProfilingLocators } from '@kbn/observability-shared-plugin/public';
|
||||
|
@ -44,32 +47,33 @@ export const getSections = ({
|
|||
basePath,
|
||||
location,
|
||||
apmRouter,
|
||||
infraLocators,
|
||||
infraLinksAvailable,
|
||||
profilingLocators,
|
||||
rangeFrom,
|
||||
rangeTo,
|
||||
environment,
|
||||
allDatasetsLocator,
|
||||
logsLocator,
|
||||
nodeLogsLocator,
|
||||
}: {
|
||||
transaction?: Transaction;
|
||||
basePath: IBasePath;
|
||||
location: Location;
|
||||
apmRouter: ApmRouter;
|
||||
infraLocators?: InfraLocators;
|
||||
infraLinksAvailable: boolean;
|
||||
profilingLocators?: ProfilingLocators;
|
||||
rangeFrom: string;
|
||||
rangeTo: string;
|
||||
environment: Environment;
|
||||
allDatasetsLocator: LocatorPublic<AllDatasetsLocatorParams>;
|
||||
logsLocator: LocatorPublic<LogsLocatorParams>;
|
||||
nodeLogsLocator: LocatorPublic<NodeLogsLocatorParams>;
|
||||
}) => {
|
||||
if (!transaction) return [];
|
||||
|
||||
const hostName = transaction.host?.hostname;
|
||||
const podId = transaction.kubernetes?.pod?.uid;
|
||||
const containerId = transaction.container?.id;
|
||||
const { nodeLogsLocator, logsLocator } = infraLocators ?? {};
|
||||
|
||||
const time = Math.round(transaction.timestamp.us / 1000);
|
||||
const infraMetricsQuery = getInfraMetricsQuery(transaction);
|
||||
|
|
|
@ -10,11 +10,16 @@ import React from 'react';
|
|||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { License } from '@kbn/licensing-plugin/common/license';
|
||||
import {
|
||||
LOGS_LOCATOR_ID,
|
||||
NODE_LOGS_LOCATOR_ID,
|
||||
} from '@kbn/logs-shared-plugin/common';
|
||||
import { Transaction } from '../../../../typings/es_schemas/ui/transaction';
|
||||
import { ApmPluginContextValue } from '../../../context/apm_plugin/apm_plugin_context';
|
||||
import {
|
||||
mockApmPluginContextValue,
|
||||
MockApmPluginContextWrapper,
|
||||
infraLocatorsMock,
|
||||
} from '../../../context/apm_plugin/mock_apm_plugin_context';
|
||||
import { LicenseContext } from '../../../context/license/license_context';
|
||||
import * as hooks from '../../../hooks/use_fetcher';
|
||||
|
@ -32,6 +37,21 @@ const apmContextMock = {
|
|||
...mockApmPluginContextValue.core,
|
||||
application: { capabilities: { apm: { save: true }, ml: {} } },
|
||||
},
|
||||
share: {
|
||||
url: {
|
||||
locators: {
|
||||
get: (id: string) => {
|
||||
if (id === LOGS_LOCATOR_ID) {
|
||||
return infraLocatorsMock.logsLocator;
|
||||
}
|
||||
|
||||
if (id === NODE_LOGS_LOCATOR_ID) {
|
||||
return infraLocatorsMock.nodeLogsLocator;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as unknown as ApmPluginContextValue;
|
||||
|
||||
const history = createMemoryHistory();
|
||||
|
@ -68,12 +88,8 @@ const renderTransaction = async (transaction: Record<string, any>) => {
|
|||
};
|
||||
|
||||
const expectInfraLocatorsToBeCalled = () => {
|
||||
expect(
|
||||
apmContextMock.infra?.locators.nodeLogsLocator.getRedirectUrl
|
||||
).toBeCalled();
|
||||
expect(
|
||||
apmContextMock.infra?.locators.logsLocator.getRedirectUrl
|
||||
).toBeCalled();
|
||||
expect(infraLocatorsMock.nodeLogsLocator.getRedirectUrl).toBeCalled();
|
||||
expect(infraLocatorsMock.logsLocator.getRedirectUrl).toBeCalled();
|
||||
};
|
||||
|
||||
describe('TransactionActionMenu component', () => {
|
||||
|
|
|
@ -25,6 +25,12 @@ import {
|
|||
AllDatasetsLocatorParams,
|
||||
ALL_DATASETS_LOCATOR_ID,
|
||||
} from '@kbn/deeplinks-observability/locators';
|
||||
import {
|
||||
LOGS_LOCATOR_ID,
|
||||
LogsLocatorParams,
|
||||
NODE_LOGS_LOCATOR_ID,
|
||||
NodeLogsLocatorParams,
|
||||
} from '@kbn/logs-shared-plugin/common';
|
||||
import type { ProfilingLocators } from '@kbn/observability-shared-plugin/public';
|
||||
import { useAnyOfApmParams } from '../../../hooks/use_apm_params';
|
||||
import { ApmFeatureFlagName } from '../../../../common/apm_feature_flags';
|
||||
|
@ -129,13 +135,17 @@ function ActionMenuSections({
|
|||
transaction?: Transaction;
|
||||
profilingLocators?: ProfilingLocators;
|
||||
}) {
|
||||
const { core, uiActions, infra, share } = useApmPluginContext();
|
||||
const { core, uiActions, share } = useApmPluginContext();
|
||||
const location = useLocation();
|
||||
const apmRouter = useApmRouter();
|
||||
|
||||
const allDatasetsLocator = share.url.locators.get<AllDatasetsLocatorParams>(
|
||||
ALL_DATASETS_LOCATOR_ID
|
||||
)!;
|
||||
const logsLocator =
|
||||
share.url.locators.get<LogsLocatorParams>(LOGS_LOCATOR_ID)!;
|
||||
const nodeLogsLocator =
|
||||
share.url.locators.get<NodeLogsLocatorParams>(NODE_LOGS_LOCATOR_ID)!;
|
||||
|
||||
const infraLinksAvailable = useApmFeatureFlag(
|
||||
ApmFeatureFlagName.InfraUiAvailable
|
||||
|
@ -155,13 +165,14 @@ function ActionMenuSections({
|
|||
basePath: core.http.basePath,
|
||||
location,
|
||||
apmRouter,
|
||||
infraLocators: infra?.locators,
|
||||
infraLinksAvailable,
|
||||
profilingLocators,
|
||||
rangeFrom,
|
||||
rangeTo,
|
||||
environment,
|
||||
allDatasetsLocator,
|
||||
logsLocator,
|
||||
nodeLogsLocator,
|
||||
});
|
||||
|
||||
const externalMenuItems = useAsync(() => {
|
||||
|
|
|
@ -15,7 +15,6 @@ import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
|
|||
import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
|
||||
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
|
||||
import type { InfraClientStartExports } from '@kbn/infra-plugin/public';
|
||||
import type { ObservabilityAIAssistantPluginStart } from '@kbn/observability-ai-assistant-plugin/public';
|
||||
import { SharePluginSetup } from '@kbn/share-plugin/public';
|
||||
import type { ApmPluginSetupDeps } from '../../plugin';
|
||||
|
@ -29,7 +28,6 @@ export interface ApmPluginContextValue {
|
|||
plugins: ApmPluginSetupDeps & { maps?: MapsStartApi };
|
||||
observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry;
|
||||
observability: ObservabilityPublicStart;
|
||||
infra?: InfraClientStartExports;
|
||||
dataViews: DataViewsPublicPluginStart;
|
||||
data: DataPublicPluginStart;
|
||||
unifiedSearch: UnifiedSearchPublicPluginStart;
|
||||
|
|
|
@ -17,7 +17,6 @@ import { UI_SETTINGS } from '@kbn/data-plugin/common';
|
|||
import { MlLocatorDefinition } from '@kbn/ml-plugin/public';
|
||||
import { enableComparisonByDefault } from '@kbn/observability-plugin/public';
|
||||
import { sharePluginMock } from '@kbn/share-plugin/public/mocks';
|
||||
import type { InfraLocators } from '@kbn/infra-plugin/common/locators';
|
||||
import { apmEnableProfilingIntegration } from '@kbn/observability-plugin/common';
|
||||
import { ApmPluginContext, ApmPluginContextValue } from './apm_plugin_context';
|
||||
import { ConfigSchema } from '../..';
|
||||
|
@ -127,16 +126,16 @@ const mockPlugin = {
|
|||
},
|
||||
};
|
||||
|
||||
export const infraLocatorsMock: InfraLocators = {
|
||||
logsLocator: sharePluginMock.createLocator(),
|
||||
nodeLogsLocator: sharePluginMock.createLocator(),
|
||||
};
|
||||
|
||||
export const observabilityLogExplorerLocatorsMock = {
|
||||
allDatasetsLocator: sharePluginMock.createLocator(),
|
||||
singleDatasetLocator: sharePluginMock.createLocator(),
|
||||
};
|
||||
|
||||
export const infraLocatorsMock = {
|
||||
nodeLogsLocator: sharePluginMock.createLocator(),
|
||||
logsLocator: sharePluginMock.createLocator(),
|
||||
};
|
||||
|
||||
const mockCorePlugins = {
|
||||
embeddable: {},
|
||||
inspector: {},
|
||||
|
@ -159,9 +158,6 @@ export const mockApmPluginContextValue = {
|
|||
plugins: mockPlugin,
|
||||
observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(),
|
||||
corePlugins: mockCorePlugins,
|
||||
infra: {
|
||||
locators: infraLocatorsMock,
|
||||
},
|
||||
deps: {},
|
||||
share: sharePluginMock.createSetupContract(),
|
||||
unifiedSearch: mockUnifiedSearch,
|
||||
|
|
|
@ -35,7 +35,7 @@ import { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
|
|||
import type { FleetStart } from '@kbn/fleet-plugin/public';
|
||||
import type { HomePublicPluginSetup } from '@kbn/home-plugin/public';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { InfraClientStartExports } from '@kbn/infra-plugin/public';
|
||||
import { MetricsDataPluginStart } from '@kbn/metrics-data-access-plugin/public';
|
||||
import { Start as InspectorPluginStart } from '@kbn/inspector-plugin/public';
|
||||
import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
|
||||
import { LensPublicStart } from '@kbn/lens-plugin/public';
|
||||
|
@ -128,7 +128,6 @@ export interface ApmPluginStartDeps {
|
|||
fieldFormats?: FieldFormatsStart;
|
||||
security?: SecurityPluginStart;
|
||||
spaces?: SpacesPluginStart;
|
||||
infra?: InfraClientStartExports;
|
||||
dataViews: DataViewsPublicPluginStart;
|
||||
unifiedSearch: UnifiedSearchPublicPluginStart;
|
||||
storage: IStorageWrapper;
|
||||
|
@ -137,6 +136,7 @@ export interface ApmPluginStartDeps {
|
|||
profiling?: ProfilingPluginStart;
|
||||
observabilityAIAssistant: ObservabilityAIAssistantPluginStart;
|
||||
dashboard: DashboardStart;
|
||||
metricsDataAccess: MetricsDataPluginStart;
|
||||
}
|
||||
|
||||
const servicesTitle = i18n.translate('xpack.apm.navigation.servicesTitle', {
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
"@kbn/alerting-plugin",
|
||||
"@kbn/cloud-plugin",
|
||||
"@kbn/features-plugin",
|
||||
"@kbn/infra-plugin",
|
||||
"@kbn/licensing-plugin",
|
||||
"@kbn/license-management-plugin",
|
||||
"@kbn/maps-plugin",
|
||||
|
|
1
x-pack/plugins/apm/typings/common.d.ts
vendored
1
x-pack/plugins/apm/typings/common.d.ts
vendored
|
@ -5,7 +5,6 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import '@kbn/infra-plugin/types/eui';
|
||||
import './apm_rum_react';
|
||||
|
||||
// Allow unknown properties in an object
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
import * as rt from 'io-ts';
|
||||
import { TimeUnitChar } from '@kbn/observability-plugin/common/utils/formatters/duration';
|
||||
import { ML_ANOMALY_THRESHOLD } from '@kbn/ml-anomaly-utils/anomaly_threshold';
|
||||
import { InventoryItemType, SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { SnapshotCustomMetricInput } from '../../http_api';
|
||||
import { InventoryItemType, SnapshotMetricType } from '../../inventory_models/types';
|
||||
|
||||
export const METRIC_THRESHOLD_ALERT_TYPE_ID = 'metrics.alert.threshold';
|
||||
export const METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID = 'metrics.alert.inventory.threshold';
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { InventoryFormatterType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { createBytesFormatter } from './bytes';
|
||||
import { formatNumber } from './number';
|
||||
import { formatPercent } from './percent';
|
||||
import { InventoryFormatterType } from '../inventory_models/types';
|
||||
import { formatHighPrecision } from './high_precision';
|
||||
import { InfraWaffleMapDataFormat } from './types';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import * as rt from 'io-ts';
|
||||
import { ItemTypeRT } from '../inventory_models/types';
|
||||
import { ItemTypeRT } from '@kbn/metrics-data-access-plugin/common';
|
||||
|
||||
const CloudAccountRT = rt.type({
|
||||
value: rt.string,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import * as rt from 'io-ts';
|
||||
import { ItemTypeRT } from '../inventory_models/types';
|
||||
import { ItemTypeRT } from '@kbn/metrics-data-access-plugin/common';
|
||||
|
||||
export const InfraMetadataRequestRT = rt.type({
|
||||
nodeId: rt.string,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { createLiteralValueFromUndefinedRT } from '@kbn/io-ts-utils';
|
||||
import * as rt from 'io-ts';
|
||||
import { MetricsUIAggregationRT } from '../inventory_models/types';
|
||||
import { MetricsUIAggregationRT } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { afterKeyObjectRT } from './metrics_explorer';
|
||||
|
||||
export const MetricsAPITimerangeRT = rt.intersection([
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import * as rt from 'io-ts';
|
||||
import { InventoryMetricRT, ItemTypeRT } from '../inventory_models/types';
|
||||
import { InventoryMetricRT, ItemTypeRT } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InfraTimerangeInputRT } from './snapshot_api';
|
||||
|
||||
const NodeDetailsDataPointRT = rt.intersection([
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { createLiteralValueFromUndefinedRT } from '@kbn/io-ts-utils';
|
||||
import * as rt from 'io-ts';
|
||||
import { SnapshotMetricTypeRT, ItemTypeRT } from '../inventory_models/types';
|
||||
import { SnapshotMetricTypeRT, ItemTypeRT } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { MetricsAPISeriesRT } from './metrics_api';
|
||||
|
||||
export const SnapshotNodePathRT = rt.intersection([
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { SnapshotMetricType, SnapshotMetricTypeKeys } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { toMetricOpt } from '../snapshot_metric_i18n';
|
||||
import { SnapshotMetricType, SnapshotMetricTypeKeys } from './types';
|
||||
|
||||
interface Lookup {
|
||||
[id: string]: string;
|
||||
|
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
import { isoToEpochRt, nonEmptyStringRt, inRangeRt } from '@kbn/io-ts-utils';
|
||||
import * as rt from 'io-ts';
|
||||
import { ItemTypeRT } from '@kbn/metrics-data-access-plugin/common';
|
||||
import {
|
||||
SnapshotCustomMetricInputRT,
|
||||
SnapshotGroupByRT,
|
||||
SnapshotMetricInputRT,
|
||||
} from '../http_api/snapshot_api';
|
||||
import { ItemTypeRT } from '../inventory_models/types';
|
||||
|
||||
export const inventoryColorPaletteRT = rt.keyof({
|
||||
status: null,
|
||||
|
|
|
@ -12,19 +12,19 @@ import {
|
|||
LogViewColumnConfiguration,
|
||||
LogViewReference,
|
||||
ResolvedLogView,
|
||||
LogsLocatorParams,
|
||||
NodeLogsLocatorParams,
|
||||
} from '@kbn/logs-shared-plugin/common';
|
||||
import { flowRight } from 'lodash';
|
||||
import { findInventoryFields } from '@kbn/metrics-data-access-plugin/common';
|
||||
import type { InfraClientCoreSetup } from '../../public/types';
|
||||
import { MESSAGE_FIELD, TIMESTAMP_FIELD } from '../constants';
|
||||
import { findInventoryFields } from '../inventory_models';
|
||||
import type { TimeRange } from '../time';
|
||||
import {
|
||||
replaceLogFilterInQueryString,
|
||||
replaceLogPositionInQueryString,
|
||||
replaceLogViewInQueryString,
|
||||
} from '../url_state_storage_service';
|
||||
import type { LogsLocatorParams } from './logs_locator';
|
||||
import type { NodeLogsLocatorParams } from './node_logs_locator';
|
||||
|
||||
interface LocationToDiscoverParams {
|
||||
core: InfraClientCoreSetup;
|
||||
|
|
|
@ -8,12 +8,15 @@
|
|||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { LogsLocatorDefinition, LogsLocatorDependencies } from './logs_locator';
|
||||
import { NodeLogsLocatorDefinition } from './node_logs_locator';
|
||||
import type { LogsLocatorParams } from './logs_locator';
|
||||
import type { NodeLogsLocatorParams } from './node_logs_locator';
|
||||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
import { findInventoryFields } from '../inventory_models';
|
||||
import { findInventoryFields } from '@kbn/metrics-data-access-plugin/common';
|
||||
import moment from 'moment';
|
||||
import { DEFAULT_LOG_VIEW, LogViewReference } from '@kbn/logs-shared-plugin/common';
|
||||
import {
|
||||
DEFAULT_LOG_VIEW,
|
||||
LogViewReference,
|
||||
LogsLocatorParams,
|
||||
NodeLogsLocatorParams,
|
||||
} from '@kbn/logs-shared-plugin/common';
|
||||
|
||||
const setupLogsLocator = async () => {
|
||||
const deps: LogsLocatorDependencies = {
|
||||
|
|
|
@ -6,24 +6,9 @@
|
|||
*/
|
||||
|
||||
import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public';
|
||||
import { SerializableRecord } from '@kbn/utility-types';
|
||||
import type { LogViewReference } from '@kbn/logs-shared-plugin/common';
|
||||
import type { TimeRange } from '../time';
|
||||
import { LOGS_LOCATOR_ID, LogsLocatorParams } from '@kbn/logs-shared-plugin/common';
|
||||
import type { InfraClientCoreSetup } from '../../public/types';
|
||||
|
||||
export const LOGS_LOCATOR_ID = 'LOGS_LOCATOR';
|
||||
|
||||
export interface LogsLocatorParams extends SerializableRecord {
|
||||
/** Defines log position */
|
||||
time?: number;
|
||||
/**
|
||||
* Optionally set the time range in the time picker.
|
||||
*/
|
||||
timeRange?: TimeRange;
|
||||
filter?: string;
|
||||
logView?: LogViewReference;
|
||||
}
|
||||
|
||||
export type LogsLocator = LocatorPublic<LogsLocatorParams>;
|
||||
|
||||
export interface LogsLocatorDependencies {
|
||||
|
|
|
@ -6,15 +6,8 @@
|
|||
*/
|
||||
|
||||
import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public';
|
||||
import type { InventoryItemType } from '../inventory_models/types';
|
||||
import type { LogsLocatorDependencies, LogsLocatorParams } from './logs_locator';
|
||||
|
||||
export const NODE_LOGS_LOCATOR_ID = 'NODE_LOGS_LOCATOR';
|
||||
|
||||
export interface NodeLogsLocatorParams extends LogsLocatorParams {
|
||||
nodeId: string;
|
||||
nodeType: InventoryItemType;
|
||||
}
|
||||
import { NODE_LOGS_LOCATOR_ID, NodeLogsLocatorParams } from '@kbn/logs-shared-plugin/common';
|
||||
import type { LogsLocatorDependencies } from './logs_locator';
|
||||
|
||||
export type NodeLogsLocator = LocatorPublic<NodeLogsLocatorParams>;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { mapValues } from 'lodash';
|
||||
import { SnapshotMetricType } from './inventory_models/types';
|
||||
import { SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
|
||||
// Lowercase versions of all metrics, for when they need to be used in the middle of a sentence;
|
||||
// these may need to be translated differently depending on language, e.g. still capitalizing "CPU"
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
import React, { useCallback, useContext, useMemo } from 'react';
|
||||
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { TriggerActionsContext } from '../../../utils/triggers_actions_context';
|
||||
import { METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID } from '../../../../common/alerting/metrics';
|
||||
import { InfraWaffleMapOptions } from '../../../lib/lib';
|
||||
import { InventoryItemType } from '../../../../common/inventory_models/types';
|
||||
import { useAlertPrefillContext } from '../../use_alert_prefill';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -31,6 +31,19 @@ import {
|
|||
import { debounce, omit } from 'lodash';
|
||||
import React, { ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import useToggle from 'react-use/lib/useToggle';
|
||||
import {
|
||||
findInventoryModel,
|
||||
awsEC2SnapshotMetricTypes,
|
||||
awsRDSSnapshotMetricTypes,
|
||||
awsS3SnapshotMetricTypes,
|
||||
awsSQSSnapshotMetricTypes,
|
||||
containerSnapshotMetricTypes,
|
||||
hostSnapshotMetricTypes,
|
||||
podSnapshotMetricTypes,
|
||||
InventoryItemType,
|
||||
SnapshotMetricType,
|
||||
SnapshotMetricTypeRT,
|
||||
} from '@kbn/metrics-data-access-plugin/common';
|
||||
import {
|
||||
Comparator,
|
||||
FilterQuery,
|
||||
|
@ -41,19 +54,6 @@ import {
|
|||
SnapshotCustomMetricInput,
|
||||
SnapshotCustomMetricInputRT,
|
||||
} from '../../../../common/http_api/snapshot_api';
|
||||
import { findInventoryModel } from '../../../../common/inventory_models';
|
||||
import { awsEC2SnapshotMetricTypes } from '../../../../common/inventory_models/aws_ec2';
|
||||
import { awsRDSSnapshotMetricTypes } from '../../../../common/inventory_models/aws_rds';
|
||||
import { awsS3SnapshotMetricTypes } from '../../../../common/inventory_models/aws_s3';
|
||||
import { awsSQSSnapshotMetricTypes } from '../../../../common/inventory_models/aws_sqs';
|
||||
import { containerSnapshotMetricTypes } from '../../../../common/inventory_models/container';
|
||||
import { hostSnapshotMetricTypes } from '../../../../common/inventory_models/host';
|
||||
import { podSnapshotMetricTypes } from '../../../../common/inventory_models/pod';
|
||||
import {
|
||||
InventoryItemType,
|
||||
SnapshotMetricType,
|
||||
SnapshotMetricTypeRT,
|
||||
} from '../../../../common/inventory_models/types';
|
||||
import { toMetricOpt } from '../../../../common/snapshot_metric_i18n';
|
||||
import {
|
||||
DerivedIndexPattern,
|
||||
|
|
|
@ -11,11 +11,11 @@ import { first, last } from 'lodash';
|
|||
import moment from 'moment';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { InventoryItemType, SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useTimelineChartTheme } from '../../../utils/use_timeline_chart_theme';
|
||||
import { InventoryMetricConditions } from '../../../../common/alerting/metrics';
|
||||
import { Color } from '../../../../common/color_palette';
|
||||
import { MetricsExplorerAggregation, MetricsExplorerRow } from '../../../../common/http_api';
|
||||
import { InventoryItemType, SnapshotMetricType } from '../../../../common/inventory_models/types';
|
||||
import { useSnapshot } from '../../../pages/metrics/inventory_view/hooks/use_snaphot';
|
||||
import { useWaffleOptionsContext } from '../../../pages/metrics/inventory_view/hooks/use_waffle_options';
|
||||
import { createInventoryMetricFormatter } from '../../../pages/metrics/inventory_view/lib/create_inventory_metric_formatter';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiExpression, EuiPopover, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui';
|
||||
import { EuiPopoverTitle, EuiButtonIcon } from '@elastic/eui';
|
||||
import { InventoryItemType } from '../../../../common/inventory_models/types';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
|
||||
interface WhenExpressionProps {
|
||||
value: InventoryItemType;
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
*/
|
||||
|
||||
import { useState } from 'react';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import {
|
||||
SnapshotMetricInput,
|
||||
SnapshotCustomMetricInput,
|
||||
} from '../../../../common/http_api/snapshot_api';
|
||||
import { InventoryItemType } from '../../../../common/inventory_models/types';
|
||||
|
||||
export const useInventoryAlertPrefill = () => {
|
||||
const [nodeType, setNodeType] = useState<InventoryItemType>('host');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { ObservabilityRuleTypeModel } from '@kbn/observability-plugin/public';
|
||||
import type { LocatorPublic } from '@kbn/share-plugin/public';
|
||||
import type { LogsLocatorParams } from '../../../common/locators';
|
||||
import type { LogsLocatorParams } from '@kbn/logs-shared-plugin/common';
|
||||
import {
|
||||
LOG_DOCUMENT_COUNT_RULE_TYPE_ID,
|
||||
PartialRuleParams,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { ALERT_REASON, ALERT_START } from '@kbn/rule-data-utils';
|
||||
import type { ObservabilityRuleTypeFormatter } from '@kbn/observability-plugin/public';
|
||||
import type { LocatorPublic } from '@kbn/share-plugin/public';
|
||||
import type { LogsLocatorParams } from '../../../common/locators';
|
||||
import type { LogsLocatorParams } from '@kbn/logs-shared-plugin/common';
|
||||
|
||||
export const createRuleFormatter: (
|
||||
logsLocator: LocatorPublic<LogsLocatorParams>
|
||||
|
|
|
@ -9,12 +9,12 @@ import { useEffect } from 'react';
|
|||
import { fold } from 'fp-ts/lib/Either';
|
||||
import { identity } from 'fp-ts/lib/function';
|
||||
import { pipe } from 'fp-ts/lib/pipeable';
|
||||
import type { InventoryItemType, InventoryMetric } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { Subject } from 'rxjs';
|
||||
import { useHTTPRequest } from '../../../hooks/use_http_request';
|
||||
import { type InfraMetadata, InfraMetadataRT } from '../../../../common/http_api/metadata_api';
|
||||
import { throwErrors, createPlainError } from '../../../../common/runtime_types';
|
||||
import { getFilteredMetrics } from '../../../pages/metrics/metric_detail/lib/get_filtered_metrics';
|
||||
import type { InventoryItemType, InventoryMetric } from '../../../../common/inventory_models/types';
|
||||
|
||||
interface UseMetadataProps {
|
||||
assetId: string;
|
||||
|
|
|
@ -9,9 +9,9 @@ import { FormattedMessage } from '@kbn/i18n-react';
|
|||
import { EuiButtonEmpty } from '@elastic/eui';
|
||||
import { useLinkProps } from '@kbn/observability-shared-plugin/public';
|
||||
import { parse } from '@kbn/datemath';
|
||||
import type { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useNodeDetailsRedirect } from '../../../pages/link_to';
|
||||
|
||||
import type { InventoryItemType } from '../../../../common/inventory_models/types';
|
||||
import { useAssetDetailsUrlState } from '../hooks/use_asset_details_url_state';
|
||||
|
||||
export interface LinkToNodeDetailsProps {
|
||||
|
|
|
@ -13,8 +13,8 @@ import { EuiFieldSearch, EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elas
|
|||
import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app';
|
||||
import { LogStream } from '@kbn/logs-shared-plugin/public';
|
||||
import { DEFAULT_LOG_VIEW, LogViewReference } from '@kbn/logs-shared-plugin/common';
|
||||
import { findInventoryFields } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
|
||||
import { findInventoryFields } from '../../../../../common/inventory_models';
|
||||
import { InfraLoadingPanel } from '../../../loading';
|
||||
import { useAssetDetailsRenderPropsContext } from '../../hooks/use_asset_details_render_props';
|
||||
import { useDataViewsProviderContext } from '../../hooks/use_data_views';
|
||||
|
|
|
@ -9,10 +9,10 @@ import React, { useMemo } from 'react';
|
|||
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
|
||||
import { useSummaryTimeRange } from '@kbn/observability-plugin/public';
|
||||
import type { TimeRange } from '@kbn/es-query';
|
||||
import type { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { findInventoryFields } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { usePluginConfig } from '../../../../containers/plugin_config_context';
|
||||
import type { AlertsEsQuery } from '../../../../common/alerts/types';
|
||||
import type { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { findInventoryFields } from '../../../../../common/inventory_models';
|
||||
import { createAlertsEsQuery } from '../../../../common/alerts/create_alerts_es_query';
|
||||
import { infraAlertFeatureIds } from '../../../../pages/metrics/hosts/components/tabs/config';
|
||||
import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana';
|
||||
|
|
|
@ -19,12 +19,12 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { getFieldByType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { parseSearchString } from './parse_search_string';
|
||||
import { ProcessesTable } from './processes_table';
|
||||
import { STATE_NAMES } from './states';
|
||||
import { SummaryTable } from './summary_table';
|
||||
import { SortBy, useProcessList, ProcessListContextProvider } from '../../hooks/use_process_list';
|
||||
import { getFieldByType } from '../../../../../common/inventory_models';
|
||||
import { useAssetDetailsRenderPropsContext } from '../../hooks/use_asset_details_render_props';
|
||||
import { useDatePickerContext } from '../../hooks/use_date_picker';
|
||||
import { ProcessesExplanationMessage } from '../../components/processes_explanation';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { TimeRange } from '@kbn/es-query';
|
||||
import { Search } from 'history';
|
||||
import type { InventoryItemType } from '../../../common/inventory_models/types';
|
||||
import type { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import type { InfraWaffleMapOptions } from '../../lib/lib';
|
||||
|
||||
export type { AssetDetailsUrlState } from './hooks/use_asset_details_url_state';
|
||||
|
|
|
@ -26,7 +26,5 @@ export const plugin: PluginInitializer<
|
|||
export { FORMATTERS } from '../common/formatters';
|
||||
export { InfraFormatterType } from './lib/lib';
|
||||
|
||||
export type InfraAppId = 'logs' | 'metrics';
|
||||
|
||||
// Shared components
|
||||
export type { InfraClientStartExports } from './types';
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { createLocatorMock } from '../common/locators/locators.mock';
|
||||
import { createInventoryViewsServiceStartMock } from './services/inventory_views/inventory_views_service.mock';
|
||||
import { createMetricsExplorerViewsServiceStartMock } from './services/metrics_explorer_views/metrics_explorer_views_service.mock';
|
||||
|
@ -17,9 +16,6 @@ export const createInfraPluginStartMock = () => ({
|
|||
metricsExplorerViews: createMetricsExplorerViewsServiceStartMock(),
|
||||
telemetry: createTelemetryServiceMock(),
|
||||
locators: createLocatorMock(),
|
||||
ContainerMetricsTable: () => <div />,
|
||||
HostMetricsTable: () => <div />,
|
||||
PodMetricsTable: () => <div />,
|
||||
});
|
||||
|
||||
export const _ensureTypeCompatibility = (): InfraClientStartExports => createInfraPluginStartMock();
|
||||
|
|
|
@ -9,9 +9,9 @@ import React from 'react';
|
|||
import { match as RouteMatch, Redirect } from 'react-router-dom';
|
||||
import { Routes, Route } from '@kbn/shared-ux-router';
|
||||
|
||||
import { inventoryModels } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { RedirectToLogs } from './redirect_to_logs';
|
||||
import { RedirectToNodeLogs } from './redirect_to_node_logs';
|
||||
import { inventoryModels } from '../../../common/inventory_models';
|
||||
|
||||
interface LinkToPageProps {
|
||||
match: RouteMatch<{}>;
|
||||
|
|
|
@ -9,10 +9,10 @@ import React from 'react';
|
|||
import { match as RouteMatch, Redirect } from 'react-router-dom';
|
||||
import { Routes, Route } from '@kbn/shared-ux-router';
|
||||
|
||||
import { inventoryModels } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { RedirectToNodeDetail } from './redirect_to_node_detail';
|
||||
import { RedirectToHostDetailViaIP } from './redirect_to_host_detail_via_ip';
|
||||
import { RedirectToInventory } from './redirect_to_inventory';
|
||||
import { inventoryModels } from '../../../common/inventory_models';
|
||||
|
||||
interface LinkToPageProps {
|
||||
match: RouteMatch<{}>;
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
import React from 'react';
|
||||
import { Redirect, useLocation, useRouteMatch } from 'react-router-dom';
|
||||
import rison from '@kbn/rison';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { replaceStateKeyInQueryString } from '../../../common/url_state_storage_service';
|
||||
import { replaceMetricTimeInQueryString } from '../metrics/metric_detail/hooks/use_metrics_time';
|
||||
import { InventoryItemType } from '../../../common/inventory_models/types';
|
||||
import { AssetDetailsUrlState } from '../../components/asset_details/types';
|
||||
import { ASSET_DETAILS_URL_STATE_KEY } from '../../components/asset_details/constants';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { useEffect } from 'react';
|
||||
import { RouteComponentProps } from 'react-router-dom';
|
||||
import { DEFAULT_LOG_VIEW } from '@kbn/logs-shared-plugin/common';
|
||||
import { InventoryItemType } from '../../../common/inventory_models/types';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
|
||||
import { useKibanaContextForPlugin } from '../../hooks/use_kibana';
|
||||
import { getFilterFromLocation, getTimeFromLocation } from './query_params';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useLocation } from 'react-router-dom';
|
|||
import type { LinkDescriptor } from '@kbn/observability-shared-plugin/public';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import rison from '@kbn/rison';
|
||||
import type { InventoryItemType } from '../../../common/inventory_models/types';
|
||||
import type { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import type { AssetDetailsUrlState, RouteState } from '../../components/asset_details/types';
|
||||
import { useKibanaContextForPlugin } from '../../hooks/use_kibana';
|
||||
import {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiPanel } from '@elastic/eu
|
|||
import { euiStyled } from '@kbn/kibana-react-plugin/common';
|
||||
import { useUiTracker } from '@kbn/observability-shared-plugin/public';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
import { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { TryItButton } from '../../../../components/try_it_button';
|
||||
import { useWaffleOptionsContext } from '../hooks/use_waffle_options';
|
||||
import { InfraFormatter } from '../../../../lib/lib';
|
||||
|
|
|
@ -29,9 +29,9 @@ import { FormattedMessage, FormattedDate } from '@kbn/i18n-react';
|
|||
import { useLinkProps, useUiTracker } from '@kbn/observability-shared-plugin/public';
|
||||
import type { TimeRange } from '@kbn/es-query';
|
||||
import { css } from '@emotion/react';
|
||||
import type { SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { Subject } from 'rxjs';
|
||||
import { datemathToEpochMillis } from '../../../../../../../utils/datemath';
|
||||
import type { SnapshotMetricType } from '../../../../../../../../common/inventory_models/types';
|
||||
import { useSorting } from '../../../../../../../hooks/use_sorting';
|
||||
import { useMetricsK8sAnomaliesResults } from '../../../../hooks/use_metrics_k8s_anomalies';
|
||||
import { useMetricsHostsAnomaliesResults } from '../../../../hooks/use_metrics_hosts_anomalies';
|
||||
|
|
|
@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import React, { useCallback } from 'react';
|
||||
import { useCurrentEuiBreakpoint } from '@elastic/eui';
|
||||
import { euiStyled } from '@kbn/kibana-react-plugin/common';
|
||||
import { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InfraWaffleMapBounds, InfraWaffleMapOptions, InfraFormatter } from '../../../../lib/lib';
|
||||
import { NoData } from '../../../../components/empty_states';
|
||||
import { InfraLoadingPanel } from '../../../../components/loading';
|
||||
|
|
|
@ -11,11 +11,11 @@ import { i18n } from '@kbn/i18n';
|
|||
import { last, first } from 'lodash';
|
||||
import React, { useState, useMemo } from 'react';
|
||||
import { EuiPopover } from '@elastic/eui';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { createWaffleMapNode } from '../lib/nodes_to_wafflemap';
|
||||
import { InfraWaffleMapNode, InfraWaffleMapOptions } from '../../../../lib/lib';
|
||||
import { fieldToName } from '../lib/field_to_display_name';
|
||||
import { NodeContextMenu } from './waffle/node_context_menu';
|
||||
import { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { SnapshotNode, SnapshotNodePath } from '../../../../../common/http_api/snapshot_api';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { awsEC2SnapshotMetricTypes } from '../../../../../../common/inventory_models/aws_ec2';
|
||||
import { awsEC2SnapshotMetricTypes } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { MetricsAndGroupByToolbarItems } from './metrics_and_groupby_toolbar_items';
|
||||
import { CloudToolbarItems } from './cloud_toolbar_items';
|
||||
import { ToolbarProps } from './types';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { awsRDSSnapshotMetricTypes } from '../../../../../../common/inventory_models/aws_rds';
|
||||
import { awsRDSSnapshotMetricTypes } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { CloudToolbarItems } from './cloud_toolbar_items';
|
||||
import { MetricsAndGroupByToolbarItems } from './metrics_and_groupby_toolbar_items';
|
||||
import type { ToolbarProps } from './types';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { awsS3SnapshotMetricTypes } from '../../../../../../common/inventory_models/aws_s3';
|
||||
import { awsS3SnapshotMetricTypes } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { CloudToolbarItems } from './cloud_toolbar_items';
|
||||
import { MetricsAndGroupByToolbarItems } from './metrics_and_groupby_toolbar_items';
|
||||
import type { ToolbarProps } from './types';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { awsSQSSnapshotMetricTypes } from '../../../../../../common/inventory_models/aws_sqs';
|
||||
import { awsSQSSnapshotMetricTypes } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { CloudToolbarItems } from './cloud_toolbar_items';
|
||||
import { MetricsAndGroupByToolbarItems } from './metrics_and_groupby_toolbar_items';
|
||||
import type { ToolbarProps } from './types';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { containerSnapshotMetricTypes } from '../../../../../../common/inventory_models/container';
|
||||
import { containerSnapshotMetricTypes } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { MetricsAndGroupByToolbarItems } from './metrics_and_groupby_toolbar_items';
|
||||
import type { ToolbarProps } from './types';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { hostSnapshotMetricTypes } from '../../../../../../common/inventory_models/host';
|
||||
import { hostSnapshotMetricTypes } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { MetricsAndGroupByToolbarItems } from './metrics_and_groupby_toolbar_items';
|
||||
import type { ToolbarProps } from './types';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { EuiFlexItem } from '@elastic/eui';
|
||||
import React, { useMemo } from 'react';
|
||||
import { SnapshotMetricType } from '../../../../../../common/inventory_models/types';
|
||||
import { SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { toMetricOpt } from '../../../../../../common/snapshot_metric_i18n';
|
||||
import { WaffleMetricControls } from '../waffle/metric_control';
|
||||
import { WaffleGroupByControls } from '../waffle/waffle_group_by_controls';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { podSnapshotMetricTypes } from '../../../../../../common/inventory_models/pod';
|
||||
import { podSnapshotMetricTypes } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { MetricsAndGroupByToolbarItems } from './metrics_and_groupby_toolbar_items';
|
||||
import type { ToolbarProps } from './types';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { EuiFlexItem } from '@elastic/eui';
|
||||
import React from 'react';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useSourceContext } from '../../../../../containers/metrics_source';
|
||||
import { useInventoryMeta } from '../../hooks/use_inventory_meta';
|
||||
import { AwsEC2ToolbarItems } from './aws_ec2_toolbar_items';
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import React, { useMemo } from 'react';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import type { InfraWaffleMapOptions } from '../../../../../lib/lib';
|
||||
import { ContentTabIds } from '../../../../../components/asset_details/types';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
import AssetDetails from '../../../../../components/asset_details/asset_details';
|
||||
import { useSourceContext } from '../../../../../containers/metrics_source';
|
||||
import { commonFlyoutTabs } from '../../../../../common/asset_details_config/asset_details_tabs';
|
||||
|
|
|
@ -9,15 +9,15 @@ import React from 'react';
|
|||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
|
||||
import { first } from 'lodash';
|
||||
import { withTheme, EuiTheme } from '@kbn/kibana-react-plugin/common';
|
||||
import { getCustomMetricLabel } from '../../../../../../common/formatters/get_custom_metric_label';
|
||||
import { SnapshotCustomMetricInput } from '../../../../../../common/http_api';
|
||||
import { useSourceContext } from '../../../../../containers/metrics_source';
|
||||
import { findInventoryModel } from '../../../../../../common/inventory_models';
|
||||
import { findInventoryModel } from '@kbn/metrics-data-access-plugin/common';
|
||||
import {
|
||||
InventoryItemType,
|
||||
SnapshotMetricType,
|
||||
SnapshotMetricTypeRT,
|
||||
} from '../../../../../../common/inventory_models/types';
|
||||
} from '@kbn/metrics-data-access-plugin/common';
|
||||
import { getCustomMetricLabel } from '../../../../../../common/formatters/get_custom_metric_label';
|
||||
import { SnapshotCustomMetricInput } from '../../../../../../common/http_api';
|
||||
import { useSourceContext } from '../../../../../containers/metrics_source';
|
||||
import { InfraWaffleMapNode } from '../../../../../lib/lib';
|
||||
import { useSnapshot } from '../../hooks/use_snaphot';
|
||||
import { createInventoryMetricFormatter } from '../../lib/create_inventory_metric_formatter';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import { euiStyled } from '@kbn/kibana-react-plugin/common';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import {
|
||||
InfraWaffleMapBounds,
|
||||
InfraWaffleMapGroupOfGroups,
|
||||
|
@ -15,7 +16,6 @@ import {
|
|||
} from '../../../../../lib/lib';
|
||||
import { GroupName } from './group_name';
|
||||
import { GroupOfNodes } from './group_of_nodes';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
|
||||
interface Props {
|
||||
onDrilldown: (filter: string) => void;
|
||||
|
|
|
@ -9,6 +9,7 @@ import React from 'react';
|
|||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { isEqual } from 'lodash';
|
||||
import { euiStyled } from '@kbn/kibana-react-plugin/common';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import {
|
||||
InfraWaffleMapBounds,
|
||||
InfraWaffleMapGroupOfNodes,
|
||||
|
@ -16,7 +17,6 @@ import {
|
|||
} from '../../../../../lib/lib';
|
||||
import { GroupName } from './group_name';
|
||||
import { Node } from './node';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
import { useAssetDetailsFlyoutState } from '../../hooks/use_asset_details_flyout_url_state';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import { euiStyled } from '@kbn/kibana-react-plugin/common';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { nodesToWaffleMap } from '../../lib/nodes_to_wafflemap';
|
||||
import { isWaffleMapGroupWithGroups, isWaffleMapGroupWithNodes } from '../../lib/type_guards';
|
||||
import { InfraWaffleMapBounds, InfraWaffleMapOptions } from '../../../../../lib/lib';
|
||||
|
@ -16,7 +17,6 @@ import { GroupOfGroups } from './group_of_groups';
|
|||
import { GroupOfNodes } from './group_of_nodes';
|
||||
import { applyWaffleMapLayout } from '../../lib/apply_wafflemap_layout';
|
||||
import { SnapshotNode } from '../../../../../../common/http_api/snapshot_api';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
import { sortNodes } from '../../lib/sort_nodes';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
import { EuiPopover } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import React, { useState, useCallback } from 'react';
|
||||
import { SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { getCustomMetricLabel } from '../../../../../../../common/formatters/get_custom_metric_label';
|
||||
import {
|
||||
SnapshotMetricInput,
|
||||
|
@ -19,7 +20,6 @@ import { MetricsContextMenu } from './metrics_context_menu';
|
|||
import { ModeSwitcher } from './mode_switcher';
|
||||
import { MetricsEditMode } from './metrics_edit_mode';
|
||||
import { CustomMetricMode } from './types';
|
||||
import { SnapshotMetricType } from '../../../../../../../common/inventory_models/types';
|
||||
import { DropdownButton } from '../../dropdown_button';
|
||||
import { DerivedIndexPattern } from '../../../../../../containers/metrics_source';
|
||||
|
||||
|
|
|
@ -7,16 +7,13 @@
|
|||
|
||||
import React, { useCallback } from 'react';
|
||||
import { EuiContextMenuPanelDescriptor, EuiContextMenu } from '@elastic/eui';
|
||||
import { SnapshotMetricTypeRT, SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { getCustomMetricLabel } from '../../../../../../../common/formatters/get_custom_metric_label';
|
||||
import {
|
||||
SnapshotMetricInput,
|
||||
SnapshotCustomMetricInput,
|
||||
SnapshotCustomMetricInputRT,
|
||||
} from '../../../../../../../common/http_api/snapshot_api';
|
||||
import {
|
||||
SnapshotMetricTypeRT,
|
||||
SnapshotMetricType,
|
||||
} from '../../../../../../../common/inventory_models/types';
|
||||
|
||||
interface Props {
|
||||
options: Array<{ text: string; value: string }>;
|
||||
|
|
|
@ -9,6 +9,7 @@ import React from 'react';
|
|||
|
||||
import { first } from 'lodash';
|
||||
import { EuiPopover, EuiToolTip } from '@elastic/eui';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useBoolean } from '../../../../../hooks/use_boolean';
|
||||
import {
|
||||
InfraWaffleMapBounds,
|
||||
|
@ -17,7 +18,6 @@ import {
|
|||
} from '../../../../../lib/lib';
|
||||
import { ConditionalToolTip } from './conditional_tooltip';
|
||||
import { colorFromValue } from '../../lib/color_from_value';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
|
||||
import { NodeContextMenu } from './node_context_menu';
|
||||
import { NodeSquare } from './node_square';
|
||||
|
|
|
@ -21,12 +21,12 @@ import {
|
|||
ActionMenuDivider,
|
||||
useLinkProps,
|
||||
} from '@kbn/observability-shared-plugin/public';
|
||||
import { findInventoryModel, findInventoryFields } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useKibanaContextForPlugin } from '../../../../../hooks/use_kibana';
|
||||
import { AlertFlyout } from '../../../../../alerting/inventory/components/alert_flyout';
|
||||
import { InfraWaffleMapNode, InfraWaffleMapOptions } from '../../../../../lib/lib';
|
||||
import { useNodeDetailsRedirect } from '../../../../link_to';
|
||||
import { findInventoryModel, findInventoryFields } from '../../../../../../common/inventory_models';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
import { navigateToUptime } from '../../lib/navigate_to_uptime';
|
||||
|
||||
interface Props {
|
||||
|
@ -64,7 +64,16 @@ export const NodeContextMenu: React.FC<Props & { theme?: EuiTheme }> = withTheme
|
|||
const inventoryId = useMemo(() => {
|
||||
if (nodeType === 'host') {
|
||||
if (node.ip) {
|
||||
return { label: <EuiCode>host.ip</EuiCode>, value: node.ip };
|
||||
return {
|
||||
label: (
|
||||
<EuiCode>
|
||||
{i18n.translate('xpack.infra.inventoryId.host.ipCodeLabel', {
|
||||
defaultMessage: 'host.ip',
|
||||
})}
|
||||
</EuiCode>
|
||||
),
|
||||
value: node.ip,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
const { id } = findInventoryFields(nodeType);
|
||||
|
|
|
@ -16,9 +16,9 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import React from 'react';
|
||||
import { euiStyled } from '@kbn/kibana-react-plugin/common';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InfraGroupByOptions } from '../../../../../lib/lib';
|
||||
import { CustomFieldPanel } from './custom_field_panel';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
import { SnapshotGroupBy } from '../../../../../../common/http_api/snapshot_api';
|
||||
import { DropdownButton } from '../dropdown_button';
|
||||
import { DerivedIndexPattern } from '../../../../../containers/metrics_source';
|
||||
|
|
|
@ -9,8 +9,8 @@ import { EuiPopover, EuiContextMenu, EuiContextMenuPanelDescriptor } from '@elas
|
|||
|
||||
import React, { useCallback, useState, useMemo } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { findInventoryModel } from '../../../../../../common/inventory_models';
|
||||
import { InventoryItemType } from '../../../../../../common/inventory_models/types';
|
||||
import { findInventoryModel } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useWaffleOptionsContext } from '../../hooks/use_waffle_options';
|
||||
import { DropdownButton } from '../dropdown_button';
|
||||
|
||||
|
|
|
@ -9,13 +9,13 @@ import { fold } from 'fp-ts/lib/Either';
|
|||
import { identity } from 'fp-ts/lib/function';
|
||||
import { pipe } from 'fp-ts/lib/pipeable';
|
||||
import { useEffect } from 'react';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
|
||||
import { useHTTPRequest } from '../../../../hooks/use_http_request';
|
||||
import {
|
||||
InventoryMetaResponseRT,
|
||||
InventoryMetaResponse,
|
||||
} from '../../../../../common/http_api/inventory_meta_api';
|
||||
import { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
|
||||
export function useInventoryMeta(
|
||||
sourceId: string,
|
||||
|
|
|
@ -10,6 +10,7 @@ import { identity } from 'fp-ts/lib/function';
|
|||
import { pipe } from 'fp-ts/lib/pipeable';
|
||||
import { first } from 'lodash';
|
||||
import { useEffect, useMemo, useCallback } from 'react';
|
||||
import type { InventoryItemType, SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { getIntervalInSeconds } from '../../../../../common/utils/get_interval_in_seconds';
|
||||
import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
|
||||
import { useHTTPRequest } from '../../../../hooks/use_http_request';
|
||||
|
@ -19,10 +20,6 @@ import {
|
|||
SnapshotRequest,
|
||||
InfraTimerangeInput,
|
||||
} from '../../../../../common/http_api/snapshot_api';
|
||||
import type {
|
||||
InventoryItemType,
|
||||
SnapshotMetricType,
|
||||
} from '../../../../../common/inventory_models/types';
|
||||
|
||||
const ONE_MINUTE = 60;
|
||||
const ONE_HOUR = ONE_MINUTE * 60;
|
||||
|
|
|
@ -10,6 +10,7 @@ import { pipe } from 'fp-ts/lib/pipeable';
|
|||
import { fold } from 'fp-ts/lib/Either';
|
||||
import { constant, identity } from 'fp-ts/lib/function';
|
||||
import createContainer from 'constate';
|
||||
import type { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InventoryViewOptions } from '../../../../../common/inventory_views/types';
|
||||
import {
|
||||
type InventoryLegendOptions,
|
||||
|
@ -24,7 +25,6 @@ import type {
|
|||
SnapshotCustomMetricInput,
|
||||
} from '../../../../../common/http_api/snapshot_api';
|
||||
import { useUrlState } from '../../../../utils/use_url_state';
|
||||
import type { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
|
||||
export const DEFAULT_LEGEND: WaffleLegendOptions = {
|
||||
palette: 'cool',
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { get, isNumber } from 'lodash';
|
||||
import { SnapshotMetricType } from '../../../../../common/inventory_models/types';
|
||||
import { SnapshotMetricType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InfraFormatterType } from '../../../../lib/lib';
|
||||
import {
|
||||
SnapshotMetricInput,
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
import { uptimeOverviewLocatorID } from '@kbn/observability-plugin/public';
|
||||
import { LocatorClient } from '@kbn/share-plugin/common/url_service/locators';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InfraWaffleMapNode } from '../../../../lib/lib';
|
||||
import { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
|
||||
export const navigateToUptime = (
|
||||
locators: LocatorClient,
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
import React from 'react';
|
||||
import { useRouteMatch } from 'react-router-dom';
|
||||
import type { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { NoRemoteCluster } from '../../../components/empty_states';
|
||||
import { SourceErrorPage } from '../../../components/source_error_page';
|
||||
import { SourceLoadingPage } from '../../../components/source_loading_page';
|
||||
import { useSourceContext } from '../../../containers/metrics_source';
|
||||
import type { InventoryItemType } from '../../../../common/inventory_models/types';
|
||||
import { AssetDetails } from '../../../components/asset_details/asset_details';
|
||||
import { MetricsPageTemplate } from '../page_template';
|
||||
import { commonFlyoutTabs } from '../../../common/asset_details_config/asset_details_tabs';
|
||||
|
|
|
@ -18,8 +18,8 @@ import { get, last, max } from 'lodash';
|
|||
import React, { ReactText } from 'react';
|
||||
|
||||
import { euiStyled } from '@kbn/kibana-react-plugin/common';
|
||||
import { InventoryFormatterType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { createFormatter } from '../../../../../common/formatters';
|
||||
import { InventoryFormatterType } from '../../../../../common/inventory_models/types';
|
||||
import { SeriesOverrides, VisSectionProps } from '../types';
|
||||
import { getChartName } from './helpers';
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
import { ReactText } from 'react';
|
||||
import Color from 'color';
|
||||
import { get, first, last, min, max } from 'lodash';
|
||||
import { createFormatter } from '../../../../../common/formatters';
|
||||
import {
|
||||
InventoryVisTypeRT,
|
||||
InventoryFormatterType,
|
||||
InventoryVisType,
|
||||
} from '../../../../../common/inventory_models/types';
|
||||
} from '@kbn/metrics-data-access-plugin/common';
|
||||
import { createFormatter } from '../../../../../common/formatters';
|
||||
import { SeriesOverrides } from '../types';
|
||||
import {
|
||||
NodeDetailsDataSeries,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { LayoutProps } from '../types';
|
||||
import { AwsEC2Layout } from './layouts/aws_ec2_layout';
|
||||
import { AwsRDSLayout } from './layouts/aws_rds_layout';
|
||||
|
|
|
@ -9,9 +9,9 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|||
import dateMath from '@kbn/datemath';
|
||||
import moment from 'moment';
|
||||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
|
||||
import { InventoryMetric, InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useTemplateHeaderBreadcrumbs } from '../../../../components/asset_details/hooks/use_page_header';
|
||||
import { useSourceContext } from '../../../../containers/metrics_source';
|
||||
import { InventoryMetric, InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { useNodeDetails } from '../hooks/use_node_details';
|
||||
import { MetricsSideNav } from './side_nav';
|
||||
import { MetricsTimeControls } from './time_controls';
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import React from 'react';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { NodeDetailsMetricData } from '../../../../../common/http_api/node_details_api';
|
||||
import { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { NoData } from '../../../../components/empty_states';
|
||||
import { InfraLoadingPanel } from '../../../../components/loading';
|
||||
import { MetricsTimeInput } from '../hooks/use_metrics_time';
|
||||
|
|
|
@ -14,8 +14,8 @@ import {
|
|||
BarSeriesStyle,
|
||||
AreaSeriesStyle,
|
||||
} from '@elastic/charts';
|
||||
import { InventoryVisType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { NodeDetailsDataSeries } from '../../../../../common/http_api/node_details_api';
|
||||
import { InventoryVisType } from '../../../../../common/inventory_models/types';
|
||||
import { useKibanaTimeZoneSetting } from '../../../../hooks/use_kibana_time_zone_setting';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React, { isValidElement, cloneElement, FunctionComponent, Children, useMemo } from 'react';
|
||||
import { EuiTitle } from '@elastic/eui';
|
||||
import { InventoryMetric } from '../../../../../common/inventory_models/types';
|
||||
import { InventoryMetric } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { LayoutProps } from '../types';
|
||||
|
||||
type SubSectionProps = LayoutProps & {
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
import { fold } from 'fp-ts/lib/Either';
|
||||
import { identity } from 'fp-ts/lib/function';
|
||||
import { pipe } from 'fp-ts/lib/pipeable';
|
||||
import { InventoryMetric, InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { throwErrors, createPlainError } from '../../../../../common/runtime_types';
|
||||
import { useHTTPRequest } from '../../../../hooks/use_http_request';
|
||||
import {
|
||||
NodeDetailsMetricDataResponseRT,
|
||||
NodeDetailsMetricDataResponse,
|
||||
} from '../../../../../common/http_api/node_details_api';
|
||||
import { InventoryMetric, InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { InfraTimerangeInput } from '../../../../../common/http_api/snapshot_api';
|
||||
|
||||
export function useNodeDetails(
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
import { EuiErrorBoundary } from '@elastic/eui';
|
||||
import React from 'react';
|
||||
import { useRouteMatch } from 'react-router-dom';
|
||||
import type { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs';
|
||||
import type { InventoryItemType } from '../../../../common/inventory_models/types';
|
||||
import { AssetDetailPage } from './asset_detail_page';
|
||||
import { MetricDetailPage } from './metric_detail_page';
|
||||
import { MetricsTimeProvider } from './hooks/use_metrics_time';
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { InventoryMetric } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { metrics } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InfraMetadataFeature } from '../../../../../common/http_api/metadata_api';
|
||||
import { InventoryMetric } from '../../../../../common/inventory_models/types';
|
||||
import { metrics } from '../../../../../common/inventory_models/metrics';
|
||||
import { TIMESTAMP_FIELD } from '../../../../../common/constants';
|
||||
|
||||
export const getFilteredMetrics = (
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import React, { useState } from 'react';
|
||||
import { useRouteMatch } from 'react-router-dom';
|
||||
import { findInventoryModel } from '@kbn/metrics-data-access-plugin/common';
|
||||
import type { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs';
|
||||
import { useMetadata } from '../../../components/asset_details/hooks/use_metadata';
|
||||
import { useSourceContext } from '../../../containers/metrics_source';
|
||||
import { InfraLoadingPanel } from '../../../components/loading';
|
||||
import { findInventoryModel } from '../../../../common/inventory_models';
|
||||
import type { NavItem } from './lib/side_nav_context';
|
||||
import { NodeDetailsPage } from './components/node_details_page';
|
||||
import type { InventoryItemType } from '../../../../common/inventory_models/types';
|
||||
import { useMetricsTimeContext } from './hooks/use_metrics_time';
|
||||
import { MetricsPageTemplate } from '../page_template';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import rt from 'io-ts';
|
||||
import { EuiTheme } from '@kbn/kibana-react-plugin/common';
|
||||
import { InventoryFormatterTypeRT } from '../../../../common/inventory_models/types';
|
||||
import { InventoryFormatterTypeRT } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { MetricsTimeInput } from './hooks/use_metrics_time';
|
||||
import { NodeDetailsMetricData } from '../../../../common/http_api/node_details_api';
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import {
|
|||
import DateMath from '@kbn/datemath';
|
||||
import { Capabilities } from '@kbn/core/public';
|
||||
import { useLinkProps } from '@kbn/observability-shared-plugin/public';
|
||||
import { InventoryItemType } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { MetricsSourceConfigurationProperties } from '../../../../../common/metrics_sources';
|
||||
import { AlertFlyout } from '../../../../alerting/metric_threshold/components/alert_flyout';
|
||||
import { MetricsExplorerSeries } from '../../../../../common/http_api/metrics_explorer';
|
||||
|
@ -27,7 +28,6 @@ import {
|
|||
} from '../hooks/use_metrics_explorer_options';
|
||||
import { createTSVBLink } from './helpers/create_tsvb_link';
|
||||
import { useNodeDetailsRedirect } from '../../../link_to';
|
||||
import { InventoryItemType } from '../../../../../common/inventory_models/types';
|
||||
import { HOST_FIELD, POD_FIELD, CONTAINER_FIELD } from '../../../../../common/constants';
|
||||
|
||||
export interface Props {
|
||||
|
|
|
@ -23,9 +23,6 @@ import type { InfraPublicConfig } from '../common/plugin_config_types';
|
|||
import { createInventoryMetricRuleType } from './alerting/inventory';
|
||||
import { createLogThresholdRuleType } from './alerting/log_threshold';
|
||||
import { createMetricThresholdRuleType } from './alerting/metric_threshold';
|
||||
import { createLazyContainerMetricsTable } from './components/infrastructure_node_metrics_tables/container/create_lazy_container_metrics_table';
|
||||
import { createLazyHostMetricsTable } from './components/infrastructure_node_metrics_tables/host/create_lazy_host_metrics_table';
|
||||
import { createLazyPodMetricsTable } from './components/infrastructure_node_metrics_tables/pod/create_lazy_pod_metrics_table';
|
||||
import { LOG_STREAM_EMBEDDABLE } from './components/log_stream/log_stream_embeddable';
|
||||
import { LogStreamEmbeddableFactoryDefinition } from './components/log_stream/log_stream_embeddable_factory';
|
||||
import {
|
||||
|
@ -45,7 +42,6 @@ import type {
|
|||
InfraClientSetupDeps,
|
||||
InfraClientStartDeps,
|
||||
InfraClientStartExports,
|
||||
InfraClientStartServices,
|
||||
} from './types';
|
||||
import { getLogsHasDataFetcher, getLogsOverviewDataFetcher } from './utils/logs_overview_fetchers';
|
||||
|
||||
|
@ -370,8 +366,6 @@ export class Plugin implements InfraClientPluginClass {
|
|||
}
|
||||
|
||||
start(core: InfraClientCoreStart, plugins: InfraClientStartDeps) {
|
||||
const getStartServices = (): InfraClientStartServices => [core, plugins, startContract];
|
||||
|
||||
const inventoryViews = this.inventoryViews.start({
|
||||
http: core.http,
|
||||
});
|
||||
|
@ -387,9 +381,6 @@ export class Plugin implements InfraClientPluginClass {
|
|||
metricsExplorerViews,
|
||||
telemetry,
|
||||
locators: this.locators!,
|
||||
ContainerMetricsTable: createLazyContainerMetricsTable(getStartServices),
|
||||
HostMetricsTable: createLazyHostMetricsTable(getStartServices),
|
||||
PodMetricsTable: createLazyPodMetricsTable(getStartServices),
|
||||
};
|
||||
|
||||
return startContract;
|
||||
|
|
|
@ -47,10 +47,6 @@ import { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugi
|
|||
import { ObservabilityAIAssistantPluginStart } from '@kbn/observability-ai-assistant-plugin/public';
|
||||
import type { CloudSetup } from '@kbn/cloud-plugin/public';
|
||||
import type { UnwrapPromise } from '../common/utility_types';
|
||||
import type {
|
||||
SourceProviderProps,
|
||||
UseNodeMetricsTableOptions,
|
||||
} from './components/infrastructure_node_metrics_tables/shared';
|
||||
import { InventoryViewsServiceStart } from './services/inventory_views';
|
||||
import { MetricsExplorerViewsServiceStart } from './services/metrics_explorer_views';
|
||||
import { ITelemetryClient } from './services/telemetry';
|
||||
|
@ -66,15 +62,6 @@ export interface InfraClientStartExports {
|
|||
metricsExplorerViews?: MetricsExplorerViewsServiceStart;
|
||||
telemetry: ITelemetryClient;
|
||||
locators: InfraLocators;
|
||||
ContainerMetricsTable: (
|
||||
props: UseNodeMetricsTableOptions & Partial<SourceProviderProps>
|
||||
) => JSX.Element;
|
||||
HostMetricsTable: (
|
||||
props: UseNodeMetricsTableOptions & Partial<SourceProviderProps>
|
||||
) => JSX.Element;
|
||||
PodMetricsTable: (
|
||||
props: UseNodeMetricsTableOptions & Partial<SourceProviderProps>
|
||||
) => JSX.Element;
|
||||
}
|
||||
|
||||
export interface InfraClientSetupDeps {
|
||||
|
|
|
@ -24,7 +24,6 @@ import {
|
|||
} from './routes/log_analysis';
|
||||
import { initMetadataRoute } from './routes/metadata';
|
||||
import { initMetricsAPIRoute } from './routes/metrics_api';
|
||||
import { initMetricExplorerRoute } from './routes/metrics_explorer';
|
||||
import { initMetricsSourceConfigurationRoutes } from './routes/metrics_sources';
|
||||
import { initNodeDetailsRoute } from './routes/node_details';
|
||||
import { initOverviewRoute } from './routes/overview';
|
||||
|
@ -49,7 +48,6 @@ export const initInfraServer = (libs: InfraBackendLibs) => {
|
|||
initValidateLogAnalysisDatasetsRoute(libs);
|
||||
initValidateLogAnalysisIndicesRoute(libs);
|
||||
initGetLogEntryExamplesRoute(libs);
|
||||
initMetricExplorerRoute(libs);
|
||||
initMetricsExplorerViewRoutes(libs);
|
||||
initMetricsAPIRoute(libs);
|
||||
initMetadataRoute(libs);
|
||||
|
|
|
@ -12,7 +12,7 @@ import { CoreSetup, IRouter, KibanaRequest, RequestHandler, RouteMethod } from '
|
|||
import { UI_SETTINGS } from '@kbn/data-plugin/server';
|
||||
import { TimeseriesVisData } from '@kbn/vis-type-timeseries-plugin/server';
|
||||
import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common';
|
||||
import { TSVBMetricModel } from '../../../../common/inventory_models/types';
|
||||
import { TSVBMetricModel } from '@kbn/metrics-data-access-plugin/common';
|
||||
import { InfraConfig } from '../../../plugin';
|
||||
import type { InfraPluginRequestHandlerContext } from '../../../types';
|
||||
import {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue