-
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.
[ObsUx] [Infra] Change container details view with asset details view (…
…#180436) Part of #179844 ### In this PR - From Inventory, open asset details page view for Containers - Show overview tab with CPU and Memory KPIs and metric charts - Metadata tab with old fields, more metadata fields will be shown in follow-up PR - Added links to container metrics documentation, currently there are no docs for K8s metrics just for docker containers #### How to test - The feature is under a FF, on inventory page go to settings and enable `Container view` - In containers inventory, select a container and click on 'Docker container metrics' link (there's an [issue](#180806) to reword this links as K8s containers are also shown) - Container details page should be shown with overview and metadata tabs - On overview tab KPIs for CPU and Memory and Metrics section with CPU and Memory charts should be displayed <img width="937" alt="image" src="https://github.com/elastic/kibana/assets/31922082/d2f25f2a-ea4f-4516-b216-38464682fd14">
- Loading branch information
1 parent
2de84ce
commit a4579a7
Showing
81 changed files
with
1,889 additions
and
374 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
packages/kbn-apm-synthtrace-client/src/lib/infra/docker_container.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,39 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/* eslint-disable max-classes-per-file */ | ||
import { Entity, Fields } from '../entity'; | ||
import { Serializable } from '../serializable'; | ||
|
||
interface DockerContainerDocument extends Fields { | ||
'container.id': string; | ||
'metricset.name'?: string; | ||
} | ||
|
||
export class DockerContainer extends Entity<DockerContainerDocument> { | ||
metrics() { | ||
return new DockerContainerMetrics({ | ||
...this.fields, | ||
'docker.cpu.total.pct': 25, | ||
'docker.memory.usage.pct': 20, | ||
}); | ||
} | ||
} | ||
|
||
export interface DockerContainerMetricsDocument extends DockerContainerDocument { | ||
'docker.cpu.total.pct': number; | ||
'docker.memory.usage.pct': number; | ||
} | ||
|
||
class DockerContainerMetrics extends Serializable<DockerContainerMetricsDocument> {} | ||
|
||
export function dockerContainer(id: string): DockerContainer { | ||
return new DockerContainer({ | ||
'container.id': id, | ||
}); | ||
} |
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
41 changes: 41 additions & 0 deletions
41
packages/kbn-apm-synthtrace/src/scenarios/infra_docker_containers.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,41 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { InfraDocument, infra } from '@kbn/apm-synthtrace-client'; | ||
|
||
import { Scenario } from '../cli/scenario'; | ||
import { withClient } from '../lib/utils/with_client'; | ||
|
||
const scenario: Scenario<InfraDocument> = async (runOptions) => { | ||
return { | ||
generate: ({ range, clients: { infraEsClient } }) => { | ||
const { numContainers = 5 } = runOptions.scenarioOpts || {}; | ||
const { logger } = runOptions; | ||
|
||
const CONTAINERS = Array(numContainers) | ||
.fill(0) | ||
.map((_, idx) => infra.dockerContainer(`container-${idx}`)); | ||
|
||
const containers = range | ||
.interval('30s') | ||
.rate(1) | ||
.generator((timestamp) => | ||
CONTAINERS.flatMap((container) => [container.metrics().timestamp(timestamp)]) | ||
); | ||
|
||
return [ | ||
withClient( | ||
infraEsClient, | ||
logger.perf('generating_infra_docker_containers', () => containers) | ||
), | ||
]; | ||
}, | ||
}; | ||
}; | ||
|
||
export default scenario; |
41 changes: 41 additions & 0 deletions
41
packages/kbn-apm-synthtrace/src/scenarios/infra_k8s_containers.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,41 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { InfraDocument, infra } from '@kbn/apm-synthtrace-client'; | ||
|
||
import { Scenario } from '../cli/scenario'; | ||
import { withClient } from '../lib/utils/with_client'; | ||
|
||
const scenario: Scenario<InfraDocument> = async (runOptions) => { | ||
return { | ||
generate: ({ range, clients: { infraEsClient } }) => { | ||
const { numContainers = 5 } = runOptions.scenarioOpts || {}; | ||
const { logger } = runOptions; | ||
|
||
const CONTAINERS = Array(numContainers) | ||
.fill(0) | ||
.map((_, idx) => infra.k8sContainer(`container-${idx}`, `pod-${idx}`, `node-${idx}`)); | ||
|
||
const containers = range | ||
.interval('30s') | ||
.rate(1) | ||
.generator((timestamp) => | ||
CONTAINERS.flatMap((container) => [container.metrics().timestamp(timestamp)]) | ||
); | ||
|
||
return [ | ||
withClient( | ||
infraEsClient, | ||
logger.perf('generating_infra_containers', () => containers) | ||
), | ||
]; | ||
}, | ||
}; | ||
}; | ||
|
||
export default scenario; |
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.