-
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.
[Metrics] Display node details metrics for kubernetes containers (#13…
…5585) * display cpu metrics for kubernetes containers * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * container k8s memory usage * naming * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * remove unused types * simplify cpu avg * node > limit Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
7db0773
commit d4139a1
Showing
7 changed files
with
190 additions
and
0 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
34 changes: 34 additions & 0 deletions
34
...k/plugins/infra/common/inventory_models/container/metrics/tsvb/container_k8s_cpu_usage.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,34 @@ | ||
/* | ||
* 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 { TSVBMetricModelCreator, TSVBMetricModel } from '../../../types'; | ||
|
||
export const containerK8sCpuUsage: TSVBMetricModelCreator = ( | ||
timeField, | ||
indexPattern, | ||
interval | ||
): TSVBMetricModel => ({ | ||
id: 'containerK8sCpuUsage', | ||
requires: ['kubernetes.container'], | ||
index_pattern: indexPattern, | ||
interval, | ||
time_field: timeField, | ||
type: 'timeseries', | ||
series: [ | ||
{ | ||
id: 'cpu', | ||
split_mode: 'everything', | ||
metrics: [ | ||
{ | ||
field: 'kubernetes.container.cpu.usage.limit.pct', | ||
id: 'avg-cpu', | ||
type: 'avg', | ||
}, | ||
], | ||
}, | ||
], | ||
}); |
34 changes: 34 additions & 0 deletions
34
...lugins/infra/common/inventory_models/container/metrics/tsvb/container_k8s_memory_usage.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,34 @@ | ||
/* | ||
* 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 { TSVBMetricModelCreator, TSVBMetricModel } from '../../../types'; | ||
|
||
export const containerK8sMemoryUsage: TSVBMetricModelCreator = ( | ||
timeField, | ||
indexPattern, | ||
interval | ||
): TSVBMetricModel => ({ | ||
id: 'containerK8sMemoryUsage', | ||
requires: ['kubernetes.container'], | ||
index_pattern: indexPattern, | ||
interval, | ||
time_field: timeField, | ||
type: 'timeseries', | ||
series: [ | ||
{ | ||
id: 'memory', | ||
split_mode: 'everything', | ||
metrics: [ | ||
{ | ||
field: 'kubernetes.container.memory.usage.limit.pct', | ||
id: 'avg-memory', | ||
type: 'avg', | ||
}, | ||
], | ||
}, | ||
], | ||
}); |
45 changes: 45 additions & 0 deletions
45
...ck/plugins/infra/common/inventory_models/container/metrics/tsvb/container_k8s_overview.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,45 @@ | ||
/* | ||
* 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 { TSVBMetricModelCreator, TSVBMetricModel } from '../../../types'; | ||
|
||
export const containerK8sOverview: TSVBMetricModelCreator = ( | ||
timeField, | ||
indexPattern, | ||
interval | ||
): TSVBMetricModel => ({ | ||
id: 'containerK8sOverview', | ||
requires: ['kubernetes.container'], | ||
index_pattern: indexPattern, | ||
interval, | ||
time_field: timeField, | ||
type: 'timeseries', | ||
series: [ | ||
{ | ||
id: 'cpu', | ||
split_mode: 'everything', | ||
metrics: [ | ||
{ | ||
field: 'kubernetes.container.cpu.usage.limit.pct', | ||
id: 'avg-cpu-total', | ||
type: 'avg', | ||
}, | ||
], | ||
}, | ||
{ | ||
id: 'memory', | ||
split_mode: 'everything', | ||
metrics: [ | ||
{ | ||
field: 'kubernetes.container.memory.usage.limit.pct', | ||
id: 'avg-memory-total', | ||
type: 'avg', | ||
}, | ||
], | ||
}, | ||
], | ||
}); |
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