diff --git a/x-pack/plugins/apm/common/service_map.ts b/x-pack/plugins/apm/common/service_map.ts index 2ff30a61499b6..dc457c38a52af 100644 --- a/x-pack/plugins/apm/common/service_map.ts +++ b/x-pack/plugins/apm/common/service_map.ts @@ -34,7 +34,6 @@ export interface Connection { } export interface ServiceNodeMetrics { - numInstances: number; avgMemoryUsage: number | null; avgCpuUsage: number | null; avgTransactionDuration: number | null; diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/Popover.stories.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/Popover.stories.tsx index e5962afd76eb8..2edd36f0d1380 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/Popover.stories.tsx +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/Popover.stories.tsx @@ -16,7 +16,6 @@ storiesOf('app/ServiceMap/Popover/ServiceMetricList', module) avgRequestsPerMinute={164.47222031860858} avgCpuUsage={0.32809666568309237} avgMemoryUsage={0.5504868173242986} - numInstances={2} isLoading={false} /> )) @@ -27,7 +26,6 @@ storiesOf('app/ServiceMap/Popover/ServiceMetricList', module) avgRequestsPerMinute={null} avgCpuUsage={null} avgMemoryUsage={null} - numInstances={1} isLoading={true} /> )) @@ -38,7 +36,6 @@ storiesOf('app/ServiceMap/Popover/ServiceMetricList', module) avgRequestsPerMinute={8.439583235652972} avgCpuUsage={null} avgMemoryUsage={null} - numInstances={1} isLoading={false} /> )) @@ -49,7 +46,6 @@ storiesOf('app/ServiceMap/Popover/ServiceMetricList', module) avgRequestsPerMinute={null} avgCpuUsage={null} avgMemoryUsage={null} - numInstances={1} isLoading={false} /> )); diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceMetricList.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceMetricList.tsx index 5c28fc0a5a7d0..39d54dc5801d2 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceMetricList.tsx +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceMetricList.tsx @@ -4,12 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - EuiBadge, - EuiFlexGroup, - EuiFlexItem, - EuiLoadingSpinner -} from '@elastic/eui'; +import { EuiFlexGroup, EuiLoadingSpinner } from '@elastic/eui'; import lightTheme from '@elastic/eui/dist/eui_theme_light.json'; import { i18n } from '@kbn/i18n'; import { isNumber } from 'lodash'; @@ -30,10 +25,6 @@ function LoadingSpinner() { ); } -const BadgeRow = styled(EuiFlexItem)` - padding-bottom: ${lightTheme.gutterTypes.gutterSmall}; -`; - export const ItemRow = styled('tr')` line-height: 2; `; @@ -57,7 +48,6 @@ export function ServiceMetricList({ avgErrorsPerMinute, avgCpuUsage, avgMemoryUsage, - numInstances, isLoading }: ServiceMetricListProps) { const listItems = [ @@ -110,39 +100,22 @@ export function ServiceMetricList({ : null } ]; - const showBadgeRow = numInstances > 1; return isLoading ? ( ) : ( - <> - {showBadgeRow && ( - - - {numInstances > 1 && ( - - {i18n.translate('xpack.apm.serviceMap.numInstancesMetric', { - values: { numInstances }, - defaultMessage: '{numInstances} instances' - })} - - )} - - - )} - - - {listItems.map( - ({ title, description }) => - description && ( - - {title} - {description} - - ) - )} - -
- + + + {listItems.map( + ({ title, description }) => + description && ( + + {title} + {description} + + ) + )} + +
); } diff --git a/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts b/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts index d7e28828572d5..7e8dccb8aff06 100644 --- a/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts +++ b/x-pack/plugins/apm/server/lib/service_map/get_service_map_service_node_info.ts @@ -14,8 +14,7 @@ import { TRANSACTION_DURATION, METRIC_SYSTEM_CPU_PERCENT, METRIC_SYSTEM_FREE_MEMORY, - METRIC_SYSTEM_TOTAL_MEMORY, - SERVICE_NODE_NAME + METRIC_SYSTEM_TOTAL_MEMORY } from '../../../common/elasticsearch_fieldnames'; import { percentMemoryUsedScript } from '../metrics/by_agent/shared/memory'; @@ -56,22 +55,19 @@ export async function getServiceMapServiceNodeInfo({ errorMetrics, transactionMetrics, cpuMetrics, - memoryMetrics, - instanceMetrics + memoryMetrics ] = await Promise.all([ getErrorMetrics(taskParams), getTransactionMetrics(taskParams), getCpuMetrics(taskParams), - getMemoryMetrics(taskParams), - getNumInstances(taskParams) + getMemoryMetrics(taskParams) ]); return { ...errorMetrics, ...transactionMetrics, ...cpuMetrics, - ...memoryMetrics, - ...instanceMetrics + ...memoryMetrics }; } @@ -226,47 +222,3 @@ async function getMemoryMetrics({ avgMemoryUsage: response.aggregations?.avgMemoryUsage.value ?? null }; } - -async function getNumInstances({ - setup, - filter -}: TaskParameters): Promise<{ numInstances: number }> { - const { client, indices } = setup; - const response = await client.search({ - index: indices['apm_oss.transactionIndices'], - body: { - query: { - bool: { - filter: filter.concat([ - { - term: { - [PROCESSOR_EVENT]: 'transaction' - } - }, - { - exists: { - field: SERVICE_NODE_NAME - } - }, - { - exists: { - field: METRIC_SYSTEM_TOTAL_MEMORY - } - } - ]) - } - }, - aggs: { - instances: { - cardinality: { - field: SERVICE_NODE_NAME - } - } - } - } - }); - - return { - numInstances: response.aggregations?.instances.value || 1 - }; -} diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index a32e268437d62..1a51b0d7ed47b 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -4389,7 +4389,6 @@ "xpack.apm.serviceMap.emptyBanner.title": "単一のサービスしかないようです。", "xpack.apm.serviceMap.focusMapButtonText": "焦点マップ", "xpack.apm.serviceMap.invalidLicenseMessage": "サービスマップを利用するには、Elastic Platinum ライセンスが必要です。これにより、APM データとともにアプリケーションスタック全てを可視化することができるようになります。", - "xpack.apm.serviceMap.numInstancesMetric": "{numInstances}インスタンス", "xpack.apm.serviceMap.serviceDetailsButtonText": "サービス詳細", "xpack.apm.serviceMap.subtypePopoverMetric": "サブタイプ", "xpack.apm.serviceMap.typePopoverMetric": "タイプ", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index d8e6b4f201d3e..2991cda099c7e 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -4390,7 +4390,6 @@ "xpack.apm.serviceMap.emptyBanner.title": "似乎仅有一个服务。", "xpack.apm.serviceMap.focusMapButtonText": "聚焦地图", "xpack.apm.serviceMap.invalidLicenseMessage": "要访问服务地图,必须订阅 Elastic 白金级许可证。使用该许可证,您将能够可视化整个应用程序堆栈以及 APM 数据。", - "xpack.apm.serviceMap.numInstancesMetric": "{numInstances} 个实例", "xpack.apm.serviceMap.serviceDetailsButtonText": "服务详情", "xpack.apm.serviceMap.subtypePopoverMetric": "子类型", "xpack.apm.serviceMap.typePopoverMetric": "类型",