Skip to content

Commit da00f77

Browse files
authored
add cGroupOverrides to the legacy config (#77180) (#77261)
* add cGroupOverrides to the legacy config * update missing usages * remove old cpu/cgroup schema
1 parent d683d01 commit da00f77

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ kibana_vars=(
1818
console.enabled
1919
console.proxyConfig
2020
console.proxyFilter
21+
ops.cGroupOverrides.cpuPath
22+
ops.cGroupOverrides.cpuAcctPath
2123
cpu.cgroup.path.override
2224
cpuacct.cgroup.path.override
2325
csp.rules
@@ -284,4 +286,4 @@ umask 0002
284286
# Therefore, we set this value here so that cgroup statistics are
285287
# available for the container this process will run in.
286288

287-
exec /usr/share/kibana/bin/kibana --cpu.cgroup.path.override=/ --cpuacct.cgroup.path.override=/ ${longopts} "$@"
289+
exec /usr/share/kibana/bin/kibana --ops.cGroupOverrides.cpuPath=/ --ops.cGroupOverrides.cpuAcctPath=/ ${longopts} "$@"

src/legacy/server/config/schema.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,6 @@ export default () =>
4949

5050
csp: HANDLED_IN_NEW_PLATFORM,
5151

52-
cpu: Joi.object({
53-
cgroup: Joi.object({
54-
path: Joi.object({
55-
override: Joi.string().default(),
56-
}),
57-
}),
58-
}),
59-
60-
cpuacct: Joi.object({
61-
cgroup: Joi.object({
62-
path: Joi.object({
63-
override: Joi.string().default(),
64-
}),
65-
}),
66-
}),
67-
6852
server: Joi.object({
6953
name: Joi.string().default(os.hostname()),
7054
// keep them for BWC, remove when not used in Legacy.
@@ -145,6 +129,10 @@ export default () =>
145129

146130
ops: Joi.object({
147131
interval: Joi.number().default(5000),
132+
cGroupOverrides: Joi.object().keys({
133+
cpuPath: Joi.string().default(),
134+
cpuAcctPath: Joi.string().default(),
135+
}),
148136
}).default(),
149137

150138
plugins: Joi.object({

src/legacy/server/status/lib/metrics.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ export class Metrics {
116116
async captureCGroups() {
117117
try {
118118
const cgroup = await cGroupStats({
119-
cpuPath: this.config.get('cpu.cgroup.path.override'),
120-
cpuAcctPath: this.config.get('cpuacct.cgroup.path.override'),
119+
cpuPath: this.config.get('ops.cGroupOverrides.cpuPath'),
120+
cpuAcctPath: this.config.get('ops.cGroupOverrides.cpuAcctPath'),
121121
});
122122

123123
if (isObject(cgroup)) {

0 commit comments

Comments
 (0)