forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ObsUX] [Infra] Add missing metrics to Docker container view (elastic…
…#184245) Closes elastic#183354 Metric section  How to test - The feature is under a FF, on inventory page go to settings and enable Container view - In containers inventory, select a docker container, you find one, filter by any `docker.` field. Click on a container. - Container details page should be shown Network and DiskIO charts, as well as CPU and Memory, on Metrics section
- Loading branch information
1 parent
4ac05a2
commit 22155ae
Showing
19 changed files
with
217 additions
and
28 deletions.
There are no files selected for viewing
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
50 changes: 50 additions & 0 deletions
50
...ity_solution/metrics_data_access/common/inventory_models/container/metrics/charts/disk.ts
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,50 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import { LensConfigWithId } from '../../../types'; | ||
import { formulas } from '../formulas'; | ||
import { | ||
DEFAULT_XY_FITTING_FUNCTION, | ||
DEFAULT_XY_HIDDEN_AXIS_TITLE, | ||
DEFAULT_XY_LEGEND, | ||
DISK_IOPS_LABEL, | ||
} from '../../../shared/charts/constants'; | ||
|
||
const dockerContainerDiskIOReadWrite: LensConfigWithId = { | ||
id: 'diskIOReadWrite', | ||
chartType: 'xy', | ||
title: DISK_IOPS_LABEL, | ||
layers: [ | ||
{ | ||
seriesType: 'area', | ||
type: 'series', | ||
xAxis: '@timestamp', | ||
yAxis: [ | ||
{ | ||
...formulas.dockerContainerDiskIORead, | ||
label: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.metric.label.read', { | ||
defaultMessage: 'Read', | ||
}), | ||
}, | ||
{ | ||
...formulas.dockerContainerDiskIOWrite, | ||
label: i18n.translate('xpack.metricsData.assetDetails.metricsCharts.metric.label.write', { | ||
defaultMessage: 'Write', | ||
}), | ||
}, | ||
], | ||
}, | ||
], | ||
...DEFAULT_XY_FITTING_FUNCTION, | ||
...DEFAULT_XY_LEGEND, | ||
...DEFAULT_XY_HIDDEN_AXIS_TITLE, | ||
}; | ||
|
||
export const diskIO = { | ||
xy: { dockerContainerDiskIOReadWrite }, | ||
}; |
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
47 changes: 47 additions & 0 deletions
47
..._solution/metrics_data_access/common/inventory_models/container/metrics/charts/network.ts
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,47 @@ | ||
/* | ||
* 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 { | ||
DEFAULT_XY_FITTING_FUNCTION, | ||
DEFAULT_XY_HIDDEN_AXIS_TITLE, | ||
DEFAULT_XY_LEGEND, | ||
NETWORK_LABEL, | ||
RX_LABEL, | ||
TX_LABEL, | ||
} from '../../../shared/charts/constants'; | ||
import { LensConfigWithId } from '../../../types'; | ||
import { formulas } from '../formulas'; | ||
|
||
const dockerContainerRxTx: LensConfigWithId = { | ||
id: 'rxTx', | ||
chartType: 'xy', | ||
title: NETWORK_LABEL, | ||
layers: [ | ||
{ | ||
seriesType: 'area', | ||
type: 'series', | ||
xAxis: '@timestamp', | ||
yAxis: [ | ||
{ | ||
...formulas.dockerContainerNetworkRx, | ||
label: RX_LABEL, | ||
}, | ||
{ | ||
...formulas.dockerContainerNetworkTx, | ||
label: TX_LABEL, | ||
}, | ||
], | ||
}, | ||
], | ||
...DEFAULT_XY_FITTING_FUNCTION, | ||
...DEFAULT_XY_LEGEND, | ||
...DEFAULT_XY_HIDDEN_AXIS_TITLE, | ||
}; | ||
|
||
export const network = { | ||
xy: { dockerContainerRxTx }, | ||
}; |
25 changes: 25 additions & 0 deletions
25
...y_solution/metrics_data_access/common/inventory_models/container/metrics/formulas/disk.ts
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,25 @@ | ||
/* | ||
* 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 type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder'; | ||
import { DISK_READ_IOPS_LABEL, DISK_WRITE_IOPS_LABEL } from '../../../shared/charts/constants'; | ||
|
||
export const dockerContainerDiskIORead: LensBaseLayer = { | ||
label: DISK_READ_IOPS_LABEL, | ||
value: "counter_rate(max(docker.diskio.read.ops), kql='docker.diskio.read.ops: *')", | ||
format: 'number', | ||
decimals: 0, | ||
normalizeByUnit: 's', | ||
}; | ||
|
||
export const dockerContainerDiskIOWrite: LensBaseLayer = { | ||
label: DISK_WRITE_IOPS_LABEL, | ||
value: "counter_rate(max(docker.diskio.write.ops), kql='docker.diskio.write.ops: *')", | ||
format: 'number', | ||
decimals: 0, | ||
normalizeByUnit: 's', | ||
}; |
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
27 changes: 27 additions & 0 deletions
27
...olution/metrics_data_access/common/inventory_models/container/metrics/formulas/network.ts
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,27 @@ | ||
/* | ||
* 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 type { LensBaseLayer } from '@kbn/lens-embeddable-utils/config_builder'; | ||
import { RX_LABEL, TX_LABEL } from '../../../shared/charts/constants'; | ||
|
||
export const dockerContainerNetworkRx: LensBaseLayer = { | ||
label: RX_LABEL, | ||
value: | ||
"average(docker.network.inbound.bytes) * 8 / (max(metricset.period, kql='docker.network.inbound.bytes: *') / 1000)", | ||
format: 'bits', | ||
decimals: 1, | ||
normalizeByUnit: 's', | ||
}; | ||
|
||
export const dockerContainerNetworkTx: LensBaseLayer = { | ||
label: TX_LABEL, | ||
value: | ||
"average(docker.network.outbound.bytes) * 8 / (max(metricset.period, kql='docker.network.outbound.bytes: *') / 1000)", | ||
format: 'bits', | ||
decimals: 1, | ||
normalizeByUnit: 's', | ||
}; |
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
Oops, something went wrong.