From 41fcaca617da86a22a579ac8cf28f41b39887232 Mon Sep 17 00:00:00 2001 From: Alex Kristiansen Date: Wed, 20 Oct 2021 12:04:16 -0700 Subject: [PATCH] add deprecation warnings to system module --- metricbeat/module/system/diskio/diskio.go | 5 ++++- metricbeat/module/system/memory/memory.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/metricbeat/module/system/diskio/diskio.go b/metricbeat/module/system/diskio/diskio.go index b47e2e76c15..e6656400b2e 100644 --- a/metricbeat/module/system/diskio/diskio.go +++ b/metricbeat/module/system/diskio/diskio.go @@ -25,6 +25,7 @@ import ( "runtime" "github.com/elastic/beats/v7/libbeat/common" + "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/libbeat/metric/system/diskio" "github.com/elastic/beats/v7/metricbeat/mb" "github.com/elastic/beats/v7/metricbeat/mb/parse" @@ -69,7 +70,9 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { if !ok { return nil, fmt.Errorf("unexpected module type") } - + if runtime.GOOS == "linux" { + cfgwarn.Deprecate("8.0", "io.ops and iostat metrics will be moved to the linux module") + } return &MetricSet{ BaseMetricSet: base, statistics: diskio.NewDiskIOStat(), diff --git a/metricbeat/module/system/memory/memory.go b/metricbeat/module/system/memory/memory.go index 4b0a6f816b5..a3d7bd13a31 100644 --- a/metricbeat/module/system/memory/memory.go +++ b/metricbeat/module/system/memory/memory.go @@ -27,6 +27,7 @@ import ( "github.com/pkg/errors" "github.com/elastic/beats/v7/libbeat/common" + "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/libbeat/common/transform/typeconv" metrics "github.com/elastic/beats/v7/metricbeat/internal/metrics/memory" "github.com/elastic/beats/v7/metricbeat/mb" @@ -54,7 +55,9 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { if !ok { return nil, fmt.Errorf("unexpected module type") } - + if runtime.GOOS == "linux" { + cfgwarn.Deprecate("8.0", "linux-only memory stats, such as hugepages, and page_stats, will be moved to the linux module") + } return &MetricSet{BaseMetricSet: base, IsAgent: systemModule.IsAgent}, nil }