chore(inputs.net): Deprecate 'ignore_protocol_stats' value 'false' (#13608)
This commit is contained in:
parent
d2dfca5def
commit
d8f8d3cbc5
|
|
@ -27,8 +27,10 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
||||||
## On linux systems telegraf also collects protocol stats.
|
## On linux systems telegraf also collects protocol stats.
|
||||||
## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
|
## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
|
||||||
##
|
##
|
||||||
|
## DEPRECATION NOTICE: A value of 'false' is deprecated and discouraged!
|
||||||
|
## Please set this to `true` and use the 'inputs.nstat'
|
||||||
|
## plugin instead.
|
||||||
# ignore_protocol_stats = false
|
# ignore_protocol_stats = false
|
||||||
##
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Metrics
|
## Metrics
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/filter"
|
"github.com/influxdata/telegraf/filter"
|
||||||
|
"github.com/influxdata/telegraf/models"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/plugins/inputs"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs/system"
|
"github.com/influxdata/telegraf/plugins/inputs/system"
|
||||||
)
|
)
|
||||||
|
|
@ -29,6 +30,20 @@ func (*NetIOStats) SampleConfig() string {
|
||||||
return sampleConfig
|
return sampleConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (n *NetIOStats) Init() error {
|
||||||
|
if !n.IgnoreProtocolStats {
|
||||||
|
models.PrintOptionValueDeprecationNotice(telegraf.Warn, "inputs.net", "ignore_protocol_stats", "false",
|
||||||
|
telegraf.DeprecationInfo{
|
||||||
|
Since: "1.27.3",
|
||||||
|
RemovalIn: "1.36.0",
|
||||||
|
Notice: "use the 'inputs.nstat' plugin instead",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (n *NetIOStats) Gather(acc telegraf.Accumulator) error {
|
func (n *NetIOStats) Gather(acc telegraf.Accumulator) error {
|
||||||
netio, err := n.ps.NetIO()
|
netio, err := n.ps.NetIO()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,7 @@
|
||||||
## On linux systems telegraf also collects protocol stats.
|
## On linux systems telegraf also collects protocol stats.
|
||||||
## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
|
## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
|
||||||
##
|
##
|
||||||
|
## DEPRECATION NOTICE: A value of 'false' is deprecated and discouraged!
|
||||||
|
## Please set this to `true` and use the 'inputs.nstat'
|
||||||
|
## plugin instead.
|
||||||
# ignore_protocol_stats = false
|
# ignore_protocol_stats = false
|
||||||
##
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue