Skip to content
Open
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
45 changes: 45 additions & 0 deletions changelog/fragments/1784889342-remove-system-hostfs.yaml
Original file line number Diff line number Diff line change
@@ -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/elastic/beats/pull/52238

# 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
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We need to make explicit about which version system.hostfs stops accepting.


This is a default metricset. If the host module is unconfigured, this metricset is enabled by default.

Expand Down
19 changes: 0 additions & 19 deletions metricbeat/internal/sysinit/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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

}
2 changes: 1 addition & 1 deletion metricbeat/module/system/process/_meta/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Loading