diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 2bff97ae4132..2cff628080d6 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -70,6 +70,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff] *Metricbeat* - Improve handling of disabled commands in Zookeeper Metricbeat module. {pull}31013[#31013] +- make `system/filesystem` code sensitive to `hostfs` and migrate libraries to `elastic-agent-opts` {pull}31001[31001] *Packetbeat* diff --git a/go.sum b/go.sum index 528e9cd84476..82a4ca0c1aea 100644 --- a/go.sum +++ b/go.sum @@ -538,11 +538,11 @@ github.com/elastic/elastic-agent-client/v7 v7.0.0-20210727140539-f0905d9377f6/go github.com/elastic/elastic-agent-libs v0.0.0-20220303160015-5b4e674da3dd/go.mod h1://82M1l73IHx0wDbS2Tzkq6Fx9fkmytS1KgkIyzvNTM= github.com/elastic/elastic-agent-libs v0.2.2/go.mod h1:1xDLBhIqBIjhJ7lr2s+xRFFkQHpitSp8q2zzv1Dqg+s= github.com/elastic/elastic-agent-libs v0.2.4 h1:TOy+vild5MSkn/eTOwrnffAeAntq4GiLpkvWe+uNVms= +github.com/elastic/elastic-agent-libs v0.2.4 h1:TOy+vild5MSkn/eTOwrnffAeAntq4GiLpkvWe+uNVms= +github.com/elastic/elastic-agent-libs v0.2.4/go.mod h1:eUiaofWIVdxVOAR4ICGxn2wbFByhrnmR6/kppwYq3qI= github.com/elastic/elastic-agent-libs v0.2.4/go.mod h1:eUiaofWIVdxVOAR4ICGxn2wbFByhrnmR6/kppwYq3qI= github.com/elastic/elastic-agent-system-metrics v0.3.1 h1:WXdDyIaBr9zIJoyvFNzgZbcFiEnmtaKfazHPJR4DJOM= github.com/elastic/elastic-agent-system-metrics v0.3.1/go.mod h1:RIYhJOS7mUeyIthfOSqmmbEILYSzaDWLi5zQ70bQo+o= -github.com/elastic/elastic-agent-libs v0.2.4 h1:TOy+vild5MSkn/eTOwrnffAeAntq4GiLpkvWe+uNVms= -github.com/elastic/elastic-agent-libs v0.2.4/go.mod h1:eUiaofWIVdxVOAR4ICGxn2wbFByhrnmR6/kppwYq3qI= github.com/elastic/fsevents v0.0.0-20181029231046-e1d381a4d270 h1:cWPqxlPtir4RoQVCpGSRXmLqjEHpJKbR60rxh1nQZY4= github.com/elastic/fsevents v0.0.0-20181029231046-e1d381a4d270/go.mod h1:Msl1pdboCbArMF/nSCDUXgQuWTeoMmE/z8607X+k7ng= github.com/elastic/glog v1.0.1-0.20210831205241-7d8b5c89dfc4 h1:ViJxdtOsHeO+SWVekzM82fYHH1xnvZ8CvGPXZj+G4YI= diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 10c0ae5faaad..0dc12daa61ad 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -60259,6 +60259,16 @@ type: long -- +*`system.filesystem.options`*:: ++ +-- +The options present on the filesystem mount. + + +type: keyword + +-- + *`system.filesystem.free`*:: + -- diff --git a/metricbeat/module/system/fields.go b/metricbeat/module/system/fields.go index 3b14efe75d10..76225cbdb264 100644 --- a/metricbeat/module/system/fields.go +++ b/metricbeat/module/system/fields.go @@ -32,5 +32,5 @@ func init() { // AssetSystem returns asset data. // This is the base64 encoded zlib format compressed contents of module/system. func AssetSystem() string { - return "eJzsfXtvG7my5//5FEQWB+PclRU7M5M7138skEnO7BqbjI04OecAi4VMdZckHrPJHpItWfPpL/joN/sltWR5YONi7oktkb8qFotVxWLVOXqA7RWSW6kgeoWQIorCFXp9Z37x+hVCIchAkFgRzq7Q/3qFEEL2j0gqrBKJIlCCBHKCKHkA9PH2O8IsRBFEXGxRIvESJkitsEJYAAo4pRAoCNFC8AipFSAeg8CKsKVDMX2FkFxxoWYBZwuyvEJKJPAKIQEUsIQrtMSvEFoQoKG8MoDOEcMRXKFY8ACkNL9DSG1j/WHBk9j9xkOL/rm1X0spmbo/FGcozqLphuy36TwPsN1wERZ+3zCb/vm2ghSsHW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WNusds4nXwESnCt0288m2DmaDbxy7dxCP5SuBd2ddN43qwIo/x//HQAA//+KtvN7" } diff --git a/metricbeat/module/system/filesystem/_meta/docs.asciidoc b/metricbeat/module/system/filesystem/_meta/docs.asciidoc index 97029f24a83e..94e97806448c 100644 --- a/metricbeat/module/system/filesystem/_meta/docs.asciidoc +++ b/metricbeat/module/system/filesystem/_meta/docs.asciidoc @@ -16,7 +16,8 @@ This metricset is available on: not be collected from filesystems matching these types. This setting also affects the `fsstats` metricset. If this option is not set, metricbeat ignores all types for virtual devices in systems where this information is available (e.g. -all types marked as `nodev` in `/proc/filesystems` in Linux systems). +all types marked as `nodev` in `/proc/filesystems` in Linux systems). This can be set to an empty list (`[]`) +to make filebeat report all filesystems, regardless of type. [float] === Filtering diff --git a/metricbeat/module/system/filesystem/_meta/fields.yml b/metricbeat/module/system/filesystem/_meta/fields.yml index ccabd39baa82..4d83cc6f2b82 100644 --- a/metricbeat/module/system/filesystem/_meta/fields.yml +++ b/metricbeat/module/system/filesystem/_meta/fields.yml @@ -25,6 +25,10 @@ type: long description: > Total number of inodes on the system, which will be a combination of files, folders, symlinks, and devices. + - name: options + type: keyword + description: > + The options present on the filesystem mount. - name: free type: long format: bytes diff --git a/metricbeat/module/system/filesystem/filesystem.go b/metricbeat/module/system/filesystem/filesystem.go index 4b0ca0a50235..6db85a805d1f 100644 --- a/metricbeat/module/system/filesystem/filesystem.go +++ b/metricbeat/module/system/filesystem/filesystem.go @@ -21,28 +21,35 @@ package filesystem import ( + "fmt" "strings" + "github.com/elastic/beats/v7/libbeat/common/transform/typeconv" + "github.com/elastic/beats/v7/metricbeat/mb" "github.com/elastic/beats/v7/metricbeat/mb/parse" "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/elastic-agent-libs/mapstr" + fs "github.com/elastic/elastic-agent-system-metrics/metric/system/filesystem" "github.com/elastic/elastic-agent-system-metrics/metric/system/resolve" - - "github.com/pkg/errors" ) -var debugf = logp.MakeDebug("system.filesystem") - func init() { mb.Registry.MustAddMetricSet("system", "filesystem", New, mb.WithHostParser(parse.EmptyHostParser), ) } +// Config stores the metricset-local config +type Config struct { + IgnoreTypes []string `config:"filesystem.ignore_types"` +} + // MetricSet for fetching filesystem metrics. type MetricSet struct { mb.BaseMetricSet config Config + sys resolve.Resolver } // New creates and returns a new instance of MetricSet. @@ -51,51 +58,46 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { if err := base.Module().UnpackConfig(&config); err != nil { return nil, err } - sys := base.Module().(resolve.Resolver) + sys, ok := base.Module().(resolve.Resolver) + if !ok { + return nil, fmt.Errorf("resolver cannot be cast from the module") + } + if config.IgnoreTypes == nil { - config.IgnoreTypes = DefaultIgnoredTypes(sys) + config.IgnoreTypes = fs.DefaultIgnoredTypes(sys) } if len(config.IgnoreTypes) > 0 { logp.Info("Ignoring filesystem types: %s", strings.Join(config.IgnoreTypes, ", ")) } - return &MetricSet{ BaseMetricSet: base, config: config, + sys: sys, }, nil } // Fetch fetches filesystem metrics for all mounted filesystems and returns // an event for each mount point. func (m *MetricSet) Fetch(r mb.ReporterV2) error { - fss, err := GetFileSystemList() - if err != nil { - return errors.Wrap(err, "error getting filesystem list") - - } - if len(m.config.IgnoreTypes) > 0 { - fss = Filter(fss, BuildTypeFilter(m.config.IgnoreTypes...)) + fsList, err := fs.GetFilesystems(m.sys, fs.BuildFilterWithList(m.config.IgnoreTypes)) + if err != nil { + return fmt.Errorf("error fetching filesystem list: %w", err) } - for _, fs := range fss { - stat, err := GetFileSystemStat(fs) - addStats := true + for _, fs := range fsList { + err := fs.GetUsage() if err != nil { - addStats = false - m.Logger().Debugf("error fetching filesystem stats for '%s': %v", fs.DirName, err) + return fmt.Errorf("error getting filesystem usage for %s: %w", fs.Directory, err) } - fsStat := FSStat{ - FileSystemUsage: stat, - DevName: fs.DevName, - Mount: fs.DirName, - SysTypeName: fs.SysTypeName, + out := mapstr.M{} + err = typeconv.Convert(&out, fs) + if err != nil { + return fmt.Errorf("error converting event %s: %w", fs.Device, err) } - AddFileSystemUsedPercentage(&fsStat) - event := mb.Event{ - MetricSetFields: GetFilesystemEvent(&fsStat, addStats), + MetricSetFields: out, } if !r.Event(event) { return nil diff --git a/metricbeat/module/system/filesystem/filesystem_test.go b/metricbeat/module/system/filesystem/filesystem_test.go index def6d0bf49fc..ee398bc34631 100644 --- a/metricbeat/module/system/filesystem/filesystem_test.go +++ b/metricbeat/module/system/filesystem/filesystem_test.go @@ -27,19 +27,25 @@ import ( mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" _ "github.com/elastic/beats/v7/metricbeat/module/system" + "github.com/elastic/elastic-agent-libs/logp" + fs "github.com/elastic/elastic-agent-system-metrics/metric/system/filesystem" "github.com/elastic/elastic-agent-system-metrics/metric/system/resolve" ) func TestFetch(t *testing.T) { f := mbtest.NewReportingMetricSetV2Error(t, getConfig()) events, errs := mbtest.ReportingFetchV2Error(f) - + err := logp.DevelopmentSetup() + assert.NoError(t, err) assert.Empty(t, errs) if !assert.NotEmpty(t, events) { t.FailNow() } - t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), - events[0].BeatEvent("system", "filesystem").Fields.StringToPrint()) + for _, event := range events { + t.Logf("%s/%s event: %+v", f.Module().Name(), f.Name(), + event.BeatEvent("system", "filesystem").Fields.StringToPrint()) + } + } func TestData(t *testing.T) { @@ -51,7 +57,7 @@ func TestData(t *testing.T) { } func getConfig() map[string]interface{} { - ignoreTypes := append(DefaultIgnoredTypes(resolve.NewTestResolver("")), "fuse.lxcfs", "fuse.gvfsd-fuse", "nsfs", "squashfs") + ignoreTypes := append(fs.DefaultIgnoredTypes(resolve.NewTestResolver("")), "fuse.lxcfs", "fuse.gvfsd-fuse", "nsfs", "squashfs") return map[string]interface{}{ "module": "system", "metricsets": []string{"filesystem"}, diff --git a/metricbeat/module/system/filesystem/helper.go b/metricbeat/module/system/filesystem/helper.go deleted file mode 100644 index a2542789fea3..000000000000 --- a/metricbeat/module/system/filesystem/helper.go +++ /dev/null @@ -1,206 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -//go:build darwin || freebsd || linux || openbsd || windows -// +build darwin freebsd linux openbsd windows - -package filesystem - -import ( - "bufio" - "os" - "path/filepath" - "strings" - "time" - - "runtime" - - "github.com/elastic/beats/v7/libbeat/common" - "github.com/elastic/elastic-agent-libs/mapstr" - "github.com/elastic/elastic-agent-system-metrics/metric/system/resolve" - sigar "github.com/elastic/gosigar" -) - -// Config stores the metricset-local config -type Config struct { - IgnoreTypes []string `config:"filesystem.ignore_types"` -} - -// FSStat contains filesystem metrics -type FSStat struct { - sigar.FileSystemUsage - DevName string `json:"device_name"` - Mount string `json:"mount_point"` - UsedPercent float64 `json:"used_p"` - SysTypeName string `json:"type"` - ctime time.Time -} - -// GetFileSystemList retreves overall filesystem stats -func GetFileSystemList() ([]sigar.FileSystem, error) { - fss := sigar.FileSystemList{} - if err := fss.Get(); err != nil { - return nil, err - } - - if runtime.GOOS == "windows" { - // No filtering on Windows - return fss.List, nil - } - - return filterFileSystemList(fss.List), nil -} - -// filterFileSystemList filters mountpoints to avoid virtual filesystems -// and duplications -func filterFileSystemList(fsList []sigar.FileSystem) []sigar.FileSystem { - var filtered []sigar.FileSystem - devices := make(map[string]sigar.FileSystem) - for _, fs := range fsList { - // Ignore relative mount points, which are present for example - // in /proc/mounts on Linux with network namespaces. - if !filepath.IsAbs(fs.DirName) { - debugf("Filtering filesystem with relative mountpoint %+v", fs) - continue - } - - // Don't do further checks in special devices - if !filepath.IsAbs(fs.DevName) { - filtered = append(filtered, fs) - continue - } - - // If the device name is a directory, this is a bind mount or nullfs, - // don't count it as it'd be counting again its parent filesystem. - devFileInfo, _ := os.Stat(fs.DevName) - if devFileInfo != nil && devFileInfo.IsDir() { - continue - } - - // If a block device is mounted multiple times (e.g. with some bind mounts), - // store it only once, and use the shorter mount point path. - if seen, found := devices[fs.DevName]; found { - if len(fs.DirName) < len(seen.DirName) { - devices[fs.DevName] = fs - } - continue - } - - devices[fs.DevName] = fs - } - - for _, fs := range devices { - filtered = append(filtered, fs) - } - - return filtered -} - -// GetFileSystemStat retreves stats for a single filesystem -func GetFileSystemStat(fs sigar.FileSystem) (sigar.FileSystemUsage, error) { - // Sigar, in line with the underlying `statfs` call on unix, refers to inodes as `files` in the fields. - // There's no performant, filesystem-independent way to get *just* the count of files, so for most uses inodes will be close enough for someone to get the gist. - stat := sigar.FileSystemUsage{} - // In some case for Windows OS the disk type value will be `unavailable` and access to this information is not allowed (ex. external disks). - if err := stat.Get(fs.DirName); err != nil { - return stat, err - } - return stat, nil -} - -// AddFileSystemUsedPercentage adds usage data to the filesystem struct -func AddFileSystemUsedPercentage(f *FSStat) { - if f.Total == 0 { - return - } - - perc := float64(f.Used) / float64(f.Used+f.Avail) - f.UsedPercent = common.Round(perc, common.DefaultDecimalPlacesCount) -} - -// GetFilesystemEvent turns a stat struct into a MapStr -func GetFilesystemEvent(fsStat *FSStat, addStats bool) mapstr.M { - evt := mapstr.M{ - "type": fsStat.SysTypeName, - "device_name": fsStat.DevName, - "mount_point": fsStat.Mount, - } - if addStats == true { - evt.Put("total", fsStat.Total) - evt.Put("available", fsStat.Avail) - evt.Put("free", fsStat.Free) - evt.Put("used", mapstr.M{ - "pct": fsStat.UsedPercent, - "bytes": fsStat.Used, - }) - } - if runtime.GOOS != "windows" { - evt.Put("files", fsStat.Files) - evt.Put("free_files", fsStat.FreeFiles) - } - return evt -} - -// Predicate is a function predicate for use with filesystems. It returns true -// if the argument matches the predicate. -type Predicate func(*sigar.FileSystem) bool - -// Filter returns a filtered list of filesystems. The in parameter -// is used as the backing storage for the returned slice and is therefore -// modified in this operation. -func Filter(in []sigar.FileSystem, p Predicate) []sigar.FileSystem { - out := in[:0] - for _, fs := range in { - if p(&fs) { - out = append(out, fs) - } - } - return out -} - -// BuildTypeFilter returns a predicate that returns false if the given -// filesystem has a type that matches one of the ignoreType values. -func BuildTypeFilter(ignoreType ...string) Predicate { - return func(fs *sigar.FileSystem) bool { - for _, fsType := range ignoreType { - // XXX (andrewkroh): SysTypeName appears to be used for non-Windows - // and TypeName is used exclusively for Windows. - if fs.SysTypeName == fsType || fs.TypeName == fsType { - return false - } - } - return true - } -} - -// DefaultIgnoredTypes tries to guess a sane list of filesystem types that -// could be ignored in the running system -func DefaultIgnoredTypes(sys resolve.Resolver) (types []string) { - // If /proc/filesystems exist, default ignored types are all marked - // as nodev - fsListFile := sys.ResolveHostFS("/proc/filesystems") - if f, err := os.Open(fsListFile); err == nil { - scanner := bufio.NewScanner(f) - for scanner.Scan() { - line := strings.Fields(scanner.Text()) - if len(line) == 2 && line[0] == "nodev" { - types = append(types, line[1]) - } - } - } - return -} diff --git a/metricbeat/module/system/filesystem/helper_test.go b/metricbeat/module/system/filesystem/helper_test.go deleted file mode 100644 index 126a44d38a35..000000000000 --- a/metricbeat/module/system/filesystem/helper_test.go +++ /dev/null @@ -1,174 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -//go:build !integration && (darwin || freebsd || linux || openbsd || windows) -// +build !integration -// +build darwin freebsd linux openbsd windows - -package filesystem - -import ( - "io/ioutil" - "os" - "runtime" - "testing" - - "github.com/stretchr/testify/assert" - - sigar "github.com/elastic/gosigar" -) - -func TestFileSystemList(t *testing.T) { - if runtime.GOOS == "darwin" && os.Getenv("TRAVIS") == "true" { - t.Skip("FileSystem test fails on Travis/OSX with i/o error") - } - - fss, err := GetFileSystemList() - if err != nil { - t.Fatal("GetFileSystemList", err) - } - assert.True(t, (len(fss) > 0)) - - for _, fs := range fss { - if fs.TypeName == "cdrom" { - continue - } - - stat, err := GetFileSystemStat(fs) - if os.IsPermission(err) { - continue - } - - if assert.NoError(t, err, "filesystem=%v: %v", fs, err) { - assert.True(t, (stat.Total >= 0)) - assert.True(t, (stat.Free >= 0)) - assert.True(t, (stat.Avail >= 0)) - assert.True(t, (stat.Used >= 0)) - - if runtime.GOOS != "windows" { - assert.NotEqual(t, "", fs.SysTypeName) - } - } - } -} - -func TestFileSystemListFiltering(t *testing.T) { - if runtime.GOOS == "windows" { - t.Skip("These cases don't need to work on Windows") - } - - fakeDevDir, err := ioutil.TempDir(os.TempDir(), "dir") - assert.Empty(t, err) - defer os.RemoveAll(fakeDevDir) - - cases := []struct { - description string - fss, expected []sigar.FileSystem - }{ - { - fss: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - {DirName: "/", DevName: "/dev/sda1"}, - }, - expected: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - }, - }, - { - description: "Don't repeat devices, shortest of dir names should be used", - fss: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - {DirName: "/bind", DevName: "/dev/sda1"}, - }, - expected: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - }, - }, - { - description: "Don't repeat devices, shortest of dir names should be used", - fss: []sigar.FileSystem{ - {DirName: "/bind", DevName: "/dev/sda1"}, - {DirName: "/", DevName: "/dev/sda1"}, - }, - expected: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - }, - }, - { - description: "Keep tmpfs", - fss: []sigar.FileSystem{ - {DirName: "/run", DevName: "tmpfs"}, - {DirName: "/tmp", DevName: "tmpfs"}, - }, - expected: []sigar.FileSystem{ - {DirName: "/run", DevName: "tmpfs"}, - {DirName: "/tmp", DevName: "tmpfs"}, - }, - }, - { - description: "Don't repeat devices, shortest of dir names should be used, keep tmpfs", - fss: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - {DirName: "/bind", DevName: "/dev/sda1"}, - {DirName: "/run", DevName: "tmpfs"}, - }, - expected: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - {DirName: "/run", DevName: "tmpfs"}, - }, - }, - { - description: "Don't keep the fs if the device is a directory (it'd be a bind mount)", - fss: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - {DirName: "/bind", DevName: fakeDevDir}, - }, - expected: []sigar.FileSystem{ - {DirName: "/", DevName: "/dev/sda1"}, - }, - }, - { - description: "Don't filter out NFS", - fss: []sigar.FileSystem{ - {DirName: "/srv/data", DevName: "192.168.42.42:/exports/nfs1"}, - }, - expected: []sigar.FileSystem{ - {DirName: "/srv/data", DevName: "192.168.42.42:/exports/nfs1"}, - }, - }, - } - - for _, c := range cases { - filtered := filterFileSystemList(c.fss) - assert.ElementsMatch(t, c.expected, filtered, c.description) - } -} - -func TestFilter(t *testing.T) { - in := []sigar.FileSystem{ - {SysTypeName: "nfs"}, - {SysTypeName: "ext4"}, - {SysTypeName: "proc"}, - {SysTypeName: "smb"}, - } - - out := Filter(in, BuildTypeFilter("nfs", "smb", "proc")) - - if assert.Len(t, out, 1) { - assert.Equal(t, "ext4", out[0].SysTypeName) - } -} diff --git a/metricbeat/module/system/fsstat/_meta/data.json b/metricbeat/module/system/fsstat/_meta/data.json index d35ba3c9fc75..184e0f6d4e72 100644 --- a/metricbeat/module/system/fsstat/_meta/data.json +++ b/metricbeat/module/system/fsstat/_meta/data.json @@ -1,28 +1,25 @@ { "@timestamp": "2017-10-12T08:05:34.853Z", - "agent": { - "hostname": "host.example.com", - "name": "host.example.com" - }, "event": { "dataset": "system.fsstat", "duration": 115000, "module": "system" }, "metricset": { - "name": "fsstat" + "name": "fsstat", + "period": 10000 }, "service": { "type": "system" }, "system": { "fsstat": { - "count": 37, - "total_files": 11762339, + "count": 4, + "total_files": 781546688, "total_size": { - "free": 168018972672, - "total": 379794051072, - "used": 211775078400 + "free": 7694209683456, + "total": 7997223641088, + "used": 303013957632 } } } diff --git a/metricbeat/module/system/fsstat/fsstat.go b/metricbeat/module/system/fsstat/fsstat.go index 3149d22f2de6..8e11a3f6f416 100644 --- a/metricbeat/module/system/fsstat/fsstat.go +++ b/metricbeat/module/system/fsstat/fsstat.go @@ -21,6 +21,7 @@ package fsstat import ( + "fmt" "runtime" "strings" @@ -28,9 +29,8 @@ import ( "github.com/elastic/beats/v7/metricbeat/mb/parse" "github.com/elastic/beats/v7/metricbeat/module/system/filesystem" "github.com/elastic/elastic-agent-libs/mapstr" + fs "github.com/elastic/elastic-agent-system-metrics/metric/system/filesystem" "github.com/elastic/elastic-agent-system-metrics/metric/system/resolve" - - "github.com/pkg/errors" ) func init() { @@ -43,6 +43,7 @@ func init() { type MetricSet struct { mb.BaseMetricSet config filesystem.Config + sys resolve.Resolver } // New creates and returns a new instance of MetricSet. @@ -51,9 +52,9 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { if err := base.Module().UnpackConfig(&config); err != nil { return nil, err } - sys := base.Module().(resolve.Resolver) + sys, _ := base.Module().(resolve.Resolver) if config.IgnoreTypes == nil { - config.IgnoreTypes = filesystem.DefaultIgnoredTypes(sys) + config.IgnoreTypes = fs.DefaultIgnoredTypes(sys) } if len(config.IgnoreTypes) > 0 { base.Logger().Info("Ignoring filesystem types: %s", strings.Join(config.IgnoreTypes, ", ")) @@ -62,36 +63,33 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { return &MetricSet{ BaseMetricSet: base, config: config, + sys: sys, }, nil } // Fetch fetches filesystem metrics for all mounted filesystems and returns // a single event containing aggregated data. func (m *MetricSet) Fetch(r mb.ReporterV2) error { - fss, err := filesystem.GetFileSystemList() + fsList, err := fs.GetFilesystems(m.sys, fs.BuildFilterWithList(m.config.IgnoreTypes)) if err != nil { - return errors.Wrap(err, "filesystem list") - } - - if len(m.config.IgnoreTypes) > 0 { - fss = filesystem.Filter(fss, filesystem.BuildTypeFilter(m.config.IgnoreTypes...)) + return fmt.Errorf("error fetching filesystem list: %w", err) } // These values are optional and could also be calculated by Kibana var totalFiles, totalSize, totalSizeFree, totalSizeUsed uint64 - for _, fs := range fss { - stat, err := filesystem.GetFileSystemStat(fs) + for _, fs := range fsList { + err := fs.GetUsage() if err != nil { - m.Logger().Debugf("error fetching filesystem stats for '%s': %v", fs.DirName, err) + m.Logger().Debugf("error fetching filesystem stats for '%s': %v", fs.Directory, err) continue } - m.Logger().Debugf("filesystem: %s total=%d, used=%d, free=%d", fs.DirName, stat.Total, stat.Used, stat.Free) + m.Logger().Debugf("filesystem: %s total=%d, used=%d, free=%d", fs.Directory, fs.Total, fs.Used.Bytes.ValueOr(0), fs.Free) - totalFiles += stat.Files - totalSize += stat.Total - totalSizeFree += stat.Free - totalSizeUsed += stat.Used + totalFiles += fs.Files.ValueOr(0) + totalSize += fs.Total.ValueOr(0) + totalSizeFree += fs.Free.ValueOr(0) + totalSizeUsed += fs.Used.Bytes.ValueOr(0) } event := mapstr.M{ @@ -100,7 +98,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error { "used": totalSizeUsed, "total": totalSize, }, - "count": len(fss), + "count": len(fsList), "total_files": totalFiles, } diff --git a/metricbeat/module/system/test_system.py b/metricbeat/module/system/test_system.py index e778f1be0121..9bf15c82444b 100644 --- a/metricbeat/module/system/test_system.py +++ b/metricbeat/module/system/test_system.py @@ -80,7 +80,7 @@ "used.pct"] } SYSTEM_FILESYSTEM[metricbeat.P_DEF] = SYSTEM_FILESYSTEM[metricbeat.P_WIN] + \ - ["files", "free_files"] + ["files", "free_files", "options"] SYSTEM_FSSTAT_FIELDS = ["count", "total_files", "total_size"]