From 3dd764edb17708a9760b1cdad0aabb17c9eb8f06 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 24 Jul 2026 16:05:19 +0530 Subject: [PATCH 1/9] Remove deprecated system.hostfs setting --- metricbeat/internal/sysinit/init.go | 19 ------------------- .../module/system/process/_meta/docs.md | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/metricbeat/internal/sysinit/init.go b/metricbeat/internal/sysinit/init.go index ac4bd7076859..124f1664bdce 100644 --- a/metricbeat/internal/sysinit/init.go +++ b/metricbeat/internal/sysinit/init.go @@ -22,7 +22,6 @@ import ( "fmt" "sync" - "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/libbeat/management" "github.com/elastic/beats/v7/metricbeat/mb" ) @@ -39,11 +38,6 @@ type HostFSConfig struct { HostFS string `config:"hostfs"` } -// MetricbeatHostFSConfig carries config information for the hostfs setting -type MetricbeatHostFSConfig struct { - HostFS string `config:"system.hostfs"` -} - // InitSystemModule initializes either either the system or linux module. This will produce different modules depending on if we're running under agent or not. func InitSystemModule(base mb.BaseModule) (mb.Module, error) { // common code for the base use case of `hostfs` being set at the module-level @@ -90,8 +84,6 @@ func metricbeatInit(base mb.BaseModule, modulePath string) (mb.Module, error) { } -// A user can supply either `system.hostfs` or `hostfs`. -// In additon, we will probably want to change Integration Config values to `hostfs` as well. // We need to figure out which one we got, if any. // Returns false if no config value was set func findConfigValue(base mb.BaseModule) (string, bool, error) { @@ -105,17 +97,6 @@ func findConfigValue(base mb.BaseModule) (string, bool, error) { return partialConfig.HostFS, true, nil } - legacyConfig := MetricbeatHostFSConfig{} - err = base.UnpackConfig(&legacyConfig) - if err != nil { - return "", false, fmt.Errorf("error unpacking legacy config: %w", err) - } - if legacyConfig.HostFS != "" { - base.Logger.Warn(cfgwarn.Deprecate("8.0.0", "The system.hostfs config value will be removed, use `hostfs` from within the module config.")) - // Only fallback to this if the user didn't set anything else - return legacyConfig.HostFS, true, nil - } - return "/", false, nil } diff --git a/metricbeat/module/system/process/_meta/docs.md b/metricbeat/module/system/process/_meta/docs.md index 719ee6623dfd..05a1eb648d1c 100644 --- a/metricbeat/module/system/process/_meta/docs.md +++ b/metricbeat/module/system/process/_meta/docs.md @@ -83,4 +83,4 @@ This metricset is available on: The process metricset supports both V1 and V2 (sometimes called unfied) cgroups controllers. However, on systems that are running a hybrid hierarchy, with both V1 and V2 controllers, metricbeat will only report one of the hierarchies for a given process. Is a process has both V1 and V2 hierarchies associated with it, metricbeat will check to see if the process is attached to any V2 controllers. If it is, it will report cgroups V2 metrics. If not, it will report V1 metrics. -A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `system.hostfs` to specify the filesystem root within the container. +A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. From 4c894bd358c0612cf98f1949c0ef07ec53e5cce7 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 24 Jul 2026 16:07:28 +0530 Subject: [PATCH 2/9] Add changelog tool --- .../1784889342-remove-system-hostfs.yaml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 changelog/fragments/1784889342-remove-system-hostfs.yaml diff --git a/changelog/fragments/1784889342-remove-system-hostfs.yaml b/changelog/fragments/1784889342-remove-system-hostfs.yaml new file mode 100644 index 000000000000..1731a14d5518 --- /dev/null +++ b/changelog/fragments/1784889342-remove-system-hostfs.yaml @@ -0,0 +1,45 @@ +# REQUIRED +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: breaking-change + +# REQUIRED for all kinds +# Change summary; a 80ish characters long description of the change. +summary: `system.hostfs` setting is removed in favor of `hostfs` setting only. + +# REQUIRED for breaking-change, deprecation, known-issue +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# description: + +# REQUIRED for breaking-change, deprecation, known-issue +# impact: + +# REQUIRED for breaking-change, deprecation, known-issue +# action: + +# REQUIRED for all kinds +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: metricbeat + +# AUTOMATED +# OPTIONAL to manually add other PR URLs +# PR URL: A link the PR that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +# pr: https://github.com/owner/repo/1234 + +# AUTOMATED +# OPTIONAL to manually add other issue URLs +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +# issue: https://github.com/owner/repo/1234 From 2d934d6e07ed0d52415934d5a758dedd087565cf Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 24 Jul 2026 16:11:40 +0530 Subject: [PATCH 3/9] fix changelog --- changelog/fragments/1784889342-remove-system-hostfs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/fragments/1784889342-remove-system-hostfs.yaml b/changelog/fragments/1784889342-remove-system-hostfs.yaml index 1731a14d5518..597acb457cbf 100644 --- a/changelog/fragments/1784889342-remove-system-hostfs.yaml +++ b/changelog/fragments/1784889342-remove-system-hostfs.yaml @@ -36,7 +36,7 @@ component: metricbeat # If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. # NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. # Please provide it if you are adding a fragment for a different PR. -# pr: https://github.com/owner/repo/1234 +pr: https://github.com/elastic/beats/pull/52238 # AUTOMATED # OPTIONAL to manually add other issue URLs From efe1f803dab075f404d7f528a097ff62eddd93d2 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 24 Jul 2026 16:12:07 +0530 Subject: [PATCH 4/9] fix changelog --- changelog/fragments/1784889342-remove-system-hostfs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/fragments/1784889342-remove-system-hostfs.yaml b/changelog/fragments/1784889342-remove-system-hostfs.yaml index 597acb457cbf..b201b421fdcd 100644 --- a/changelog/fragments/1784889342-remove-system-hostfs.yaml +++ b/changelog/fragments/1784889342-remove-system-hostfs.yaml @@ -13,7 +13,7 @@ kind: breaking-change # REQUIRED for all kinds # Change summary; a 80ish characters long description of the change. -summary: `system.hostfs` setting is removed in favor of `hostfs` setting only. +summary: system.hostfs setting is removed in favor of `hostfs` setting only. # REQUIRED for breaking-change, deprecation, known-issue # Long description; in case the summary is not enough to describe the change From 8352b111772ad03162dc3800bf0ee00875e32807 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 24 Jul 2026 17:11:20 +0530 Subject: [PATCH 5/9] fix docs --- .../reference/metricbeat/metricbeat-metricset-system-process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/metricbeat/metricbeat-metricset-system-process.md b/docs/reference/metricbeat/metricbeat-metricset-system-process.md index c74dea4ef13e..7ee72704b66f 100644 --- a/docs/reference/metricbeat/metricbeat-metricset-system-process.md +++ b/docs/reference/metricbeat/metricbeat-metricset-system-process.md @@ -95,7 +95,7 @@ This metricset is available on: The process metricset supports both V1 and V2 (sometimes called unfied) cgroups controllers. However, on systems that are running a hybrid hierarchy, with both V1 and V2 controllers, metricbeat will only report one of the hierarchies for a given process. Is a process has both V1 and V2 hierarchies associated with it, metricbeat will check to see if the process is attached to any V2 controllers. If it is, it will report cgroups V2 metrics. If not, it will report V1 metrics. -A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `system.hostfs` to specify the filesystem root within the container. +A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. From e45e3a17ce641062dfe64da8d2499262e5dab3a2 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Wed, 29 Jul 2026 17:52:45 +0530 Subject: [PATCH 6/9] address review comments --- .../reference/metricbeat/metricbeat-metricset-system-process.md | 2 +- metricbeat/module/system/process/_meta/docs.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/metricbeat/metricbeat-metricset-system-process.md b/docs/reference/metricbeat/metricbeat-metricset-system-process.md index 7ee72704b66f..a2a6b936de65 100644 --- a/docs/reference/metricbeat/metricbeat-metricset-system-process.md +++ b/docs/reference/metricbeat/metricbeat-metricset-system-process.md @@ -95,7 +95,7 @@ This metricset is available on: The process metricset supports both V1 and V2 (sometimes called unfied) cgroups controllers. However, on systems that are running a hybrid hierarchy, with both V1 and V2 controllers, metricbeat will only report one of the hierarchies for a given process. Is a process has both V1 and V2 hierarchies associated with it, metricbeat will check to see if the process is attached to any V2 controllers. If it is, it will report cgroups V2 metrics. If not, it will report V1 metrics. -A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. +A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. The legacy `system.hostfs` setting is no longer accepted starting in 9.6.0; use the module-level `hostfs` setting instead. This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. diff --git a/metricbeat/module/system/process/_meta/docs.md b/metricbeat/module/system/process/_meta/docs.md index 05a1eb648d1c..7256f46faac7 100644 --- a/metricbeat/module/system/process/_meta/docs.md +++ b/metricbeat/module/system/process/_meta/docs.md @@ -83,4 +83,4 @@ This metricset is available on: The process metricset supports both V1 and V2 (sometimes called unfied) cgroups controllers. However, on systems that are running a hybrid hierarchy, with both V1 and V2 controllers, metricbeat will only report one of the hierarchies for a given process. Is a process has both V1 and V2 hierarchies associated with it, metricbeat will check to see if the process is attached to any V2 controllers. If it is, it will report cgroups V2 metrics. If not, it will report V1 metrics. -A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. +A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. The legacy `system.hostfs` setting is no longer accepted starting in 9.6.0; use the module-level `hostfs` setting instead. From 587bd97869204f58e03b77d9a4e8f63719977b69 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 30 Jul 2026 11:53:34 +0530 Subject: [PATCH 7/9] Update metricbeat/module/system/process/_meta/docs.md Co-authored-by: Visha Angelova <91186315+vishaangelova@users.noreply.github.com> --- metricbeat/module/system/process/_meta/docs.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metricbeat/module/system/process/_meta/docs.md b/metricbeat/module/system/process/_meta/docs.md index 7256f46faac7..d2543e6e267b 100644 --- a/metricbeat/module/system/process/_meta/docs.md +++ b/metricbeat/module/system/process/_meta/docs.md @@ -83,4 +83,6 @@ This metricset is available on: The process metricset supports both V1 and V2 (sometimes called unfied) cgroups controllers. However, on systems that are running a hybrid hierarchy, with both V1 and V2 controllers, metricbeat will only report one of the hierarchies for a given process. Is a process has both V1 and V2 hierarchies associated with it, metricbeat will check to see if the process is attached to any V2 controllers. If it is, it will report cgroups V2 metrics. If not, it will report V1 metrics. -A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. The legacy `system.hostfs` setting is no longer accepted starting in 9.6.0; use the module-level `hostfs` setting instead. +A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. + +{applies_to}`stack: ga 9.6.0` The legacy `system.hostfs` setting is no longer accepted. Use the module-level `hostfs` setting instead. From e41fa2a098f0833483801b95237dab9b73ebedc2 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 30 Jul 2026 11:55:57 +0530 Subject: [PATCH 8/9] appy suggestion --- .../metricbeat/metricbeat-metricset-system-process.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/reference/metricbeat/metricbeat-metricset-system-process.md b/docs/reference/metricbeat/metricbeat-metricset-system-process.md index a2a6b936de65..dd189996f367 100644 --- a/docs/reference/metricbeat/metricbeat-metricset-system-process.md +++ b/docs/reference/metricbeat/metricbeat-metricset-system-process.md @@ -95,7 +95,9 @@ This metricset is available on: The process metricset supports both V1 and V2 (sometimes called unfied) cgroups controllers. However, on systems that are running a hybrid hierarchy, with both V1 and V2 controllers, metricbeat will only report one of the hierarchies for a given process. Is a process has both V1 and V2 hierarchies associated with it, metricbeat will check to see if the process is attached to any V2 controllers. If it is, it will report cgroups V2 metrics. If not, it will report V1 metrics. -A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. The legacy `system.hostfs` setting is no longer accepted starting in 9.6.0; use the module-level `hostfs` setting instead. +A workaround is also required if metricbeat is running inside docker on a hybrid system. Within docker, metricbeat won’t be able to see any V2 cgroups components. If you wish to monitor cgroups V2 from within docker on a hybrid system, you must mount the unified sysfs hierarchy (usually `/sys/fs/cgroups/unified`) inside the container, and then use `hostfs` to specify the filesystem root within the container. + +{applies_to}`stack: ga 9.6.0` The legacy `system.hostfs` setting is no longer accepted. Use the module-level `hostfs` setting instead. This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. From 52a8dd15aa2ca34b4d53c7827dc9f504c961eddb Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 30 Jul 2026 18:24:20 +0530 Subject: [PATCH 9/9] Update changelog/fragments/1784889342-remove-system-hostfs.yaml Co-authored-by: Orestis Floros --- changelog/fragments/1784889342-remove-system-hostfs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/fragments/1784889342-remove-system-hostfs.yaml b/changelog/fragments/1784889342-remove-system-hostfs.yaml index b201b421fdcd..72c5205bb39d 100644 --- a/changelog/fragments/1784889342-remove-system-hostfs.yaml +++ b/changelog/fragments/1784889342-remove-system-hostfs.yaml @@ -13,7 +13,7 @@ kind: breaking-change # REQUIRED for all kinds # Change summary; a 80ish characters long description of the change. -summary: system.hostfs setting is removed in favor of `hostfs` setting only. +summary: Deprecated system.hostfs setting is removed in favor of `hostfs` setting only. # REQUIRED for breaking-change, deprecation, known-issue # Long description; in case the summary is not enough to describe the change