Skip to content

Commit

Permalink
add deprecation warnings to system module (#28574)
Browse files Browse the repository at this point in the history
  • Loading branch information
fearful-symmetry authored Oct 25, 2021
1 parent aa75e6c commit 057e07b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion metricbeat/module/system/diskio/diskio.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
Expand Down
5 changes: 4 additions & 1 deletion metricbeat/module/system/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 057e07b

Please sign in to comment.