Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cGroupOverrides to the legacy config #77180

Merged
merged 4 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ kibana_vars=(
console.enabled
console.proxyConfig
console.proxyFilter
ops.cGroupOverrides.cpuPath
ops.cGroupOverrides.cpuAcctPath
cpu.cgroup.path.override
cpuacct.cgroup.path.override
Comment on lines +21 to 24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the new ones, but also kept the deprecated name to avoid a breaking change

csp.rules
Expand Down Expand Up @@ -279,4 +281,4 @@ umask 0002
# Therefore, we set this value here so that cgroup statistics are
# available for the container this process will run in.

exec /usr/share/kibana/bin/kibana --cpu.cgroup.path.override=/ --cpuacct.cgroup.path.override=/ ${longopts} "$@"
exec /usr/share/kibana/bin/kibana --ops.cGroupOverrides.cpuPath=/ --ops.cGroupOverrides.cpuAcctPath=/ ${longopts} "$@"
20 changes: 4 additions & 16 deletions src/legacy/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,6 @@ export default () =>

csp: HANDLED_IN_NEW_PLATFORM,

cpu: Joi.object({
cgroup: Joi.object({
path: Joi.object({
override: Joi.string().default(),
}),
}),
}),

cpuacct: Joi.object({
cgroup: Joi.object({
path: Joi.object({
override: Joi.string().default(),
}),
}),
}),

server: Joi.object({
name: Joi.string().default(os.hostname()),
// keep them for BWC, remove when not used in Legacy.
Expand Down Expand Up @@ -144,6 +128,10 @@ export default () =>

ops: Joi.object({
interval: Joi.number().default(5000),
cGroupOverrides: Joi.object().keys({
cpuPath: Joi.string().default(),
cpuAcctPath: Joi.string().default(),
}),
}).default(),

plugins: Joi.object({
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/server/status/lib/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ export class Metrics {
async captureCGroups() {
try {
const cgroup = await cGroupStats({
cpuPath: this.config.get('cpu.cgroup.path.override'),
cpuAcctPath: this.config.get('cpuacct.cgroup.path.override'),
cpuPath: this.config.get('ops.cGroupOverrides.cpuPath'),
cpuAcctPath: this.config.get('ops.cGroupOverrides.cpuAcctPath'),
});

if (isObject(cgroup)) {
Expand Down