mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[APM] Remove service maps badge row and num instances in popover (#65492)
* Closes #65487 by removing the badge row and num instances metrics * removed unused translations for xpack.apm.serviceMap.numInstancesMetric
This commit is contained in:
parent
6dd5ba0e67
commit
41c8426842
6 changed files with 18 additions and 100 deletions
|
@ -34,7 +34,6 @@ export interface Connection {
|
|||
}
|
||||
|
||||
export interface ServiceNodeMetrics {
|
||||
numInstances: number;
|
||||
avgMemoryUsage: number | null;
|
||||
avgCpuUsage: number | null;
|
||||
avgTransactionDuration: number | null;
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
));
|
||||
|
|
|
@ -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 ? (
|
||||
<LoadingSpinner />
|
||||
) : (
|
||||
<>
|
||||
{showBadgeRow && (
|
||||
<BadgeRow>
|
||||
<EuiFlexGroup gutterSize="none">
|
||||
{numInstances > 1 && (
|
||||
<EuiBadge iconType="apps" color="hollow">
|
||||
{i18n.translate('xpack.apm.serviceMap.numInstancesMetric', {
|
||||
values: { numInstances },
|
||||
defaultMessage: '{numInstances} instances'
|
||||
})}
|
||||
</EuiBadge>
|
||||
)}
|
||||
</EuiFlexGroup>
|
||||
</BadgeRow>
|
||||
)}
|
||||
<table>
|
||||
<tbody>
|
||||
{listItems.map(
|
||||
({ title, description }) =>
|
||||
description && (
|
||||
<ItemRow key={title}>
|
||||
<ItemTitle>{title}</ItemTitle>
|
||||
<ItemDescription>{description}</ItemDescription>
|
||||
</ItemRow>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</>
|
||||
<table>
|
||||
<tbody>
|
||||
{listItems.map(
|
||||
({ title, description }) =>
|
||||
description && (
|
||||
<ItemRow key={title}>
|
||||
<ItemTitle>{title}</ItemTitle>
|
||||
<ItemDescription>{description}</ItemDescription>
|
||||
</ItemRow>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4386,7 +4386,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": "タイプ",
|
||||
|
|
|
@ -4387,7 +4387,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": "类型",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue