-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Monitoring] Added cgroup option for APM cpu usage (#90873)
* Added APM cpu cgroup * Fixed tests * Fixed i18n * Removed agent logic and fixed tests * Fixed test * Fixed tests and backup field * Removed backup field fix * Fixed cluster tests Co-authored-by: Kibana Machine <[email protected]> # Conflicts: # x-pack/plugins/monitoring/public/components/apm/instance/instance.js # x-pack/plugins/monitoring/public/components/apm/overview/index.js
- Loading branch information
Showing
23 changed files
with
252 additions
and
108 deletions.
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
x-pack/plugins/monitoring/public/components/apm/apm_metrics.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { | ||
EuiFlexItem, | ||
EuiPanel, | ||
EuiSpacer, | ||
EuiPage, | ||
EuiPageBody, | ||
EuiFlexGroup, | ||
EuiPageContent, | ||
EuiScreenReaderOnly, | ||
EuiTitle, | ||
} from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
// @ts-ignore could not find declaration file | ||
import { MonitoringTimeseriesContainer } from '../chart'; | ||
// @ts-ignore could not find declaration file | ||
import { Status } from './instance/status'; | ||
|
||
interface Props { | ||
stats: unknown; | ||
metrics: { [key: string]: unknown }; | ||
seriesToShow: unknown[]; | ||
title: string; | ||
} | ||
|
||
const createCharts = (series: unknown[], props: Partial<Props>) => { | ||
return series.map((data, index) => { | ||
return ( | ||
<EuiFlexItem style={{ minWidth: '45%' }} key={index}> | ||
<MonitoringTimeseriesContainer {...props} series={data} /> | ||
</EuiFlexItem> | ||
); | ||
}); | ||
}; | ||
|
||
export const ApmMetrics = ({ stats, metrics, seriesToShow, title, ...props }: Props) => { | ||
const topSeries = [metrics.apm_cpu, metrics.apm_memory, metrics.apm_os_load]; | ||
|
||
return ( | ||
<EuiPage> | ||
<EuiPageBody> | ||
<EuiScreenReaderOnly> | ||
<h1> | ||
<FormattedMessage | ||
id="xpack.monitoring.apm.metrics.heading" | ||
defaultMessage="APM server" | ||
/> | ||
</h1> | ||
</EuiScreenReaderOnly> | ||
<EuiPanel> | ||
<Status stats={stats} /> | ||
</EuiPanel> | ||
<EuiSpacer size="m" /> | ||
<EuiPanel> | ||
<EuiTitle> | ||
<h3> | ||
{i18n.translate('xpack.monitoring.apm.metrics.topCharts.nonAgentTitle', { | ||
defaultMessage: 'APM Server - Resource Usage', | ||
})} | ||
</h3> | ||
</EuiTitle> | ||
<EuiSpacer size="m" /> | ||
<EuiFlexGroup wrap>{createCharts(topSeries, props)}</EuiFlexGroup> | ||
</EuiPanel> | ||
<EuiSpacer size="m" /> | ||
<EuiPageContent> | ||
<EuiTitle> | ||
<h3>{title}</h3> | ||
</EuiTitle> | ||
<EuiSpacer size="m" /> | ||
<EuiFlexGroup wrap>{createCharts(seriesToShow, props)}</EuiFlexGroup> | ||
</EuiPageContent> | ||
</EuiPageBody> | ||
</EuiPage> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
x-pack/plugins/monitoring/server/lib/metrics/__snapshots__/metrics.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.