Skip to content

Commit

Permalink
Add inputs.io to list of deprecated plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Rebhan committed Nov 11, 2021
1 parent 7b51960 commit 82226a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,9 @@ func (c *Config) addInput(name string, table *ast.Table) error {

// Legacy support renaming io input to diskio
if name == "io" {
if err := c.printUserDeprecation("inputs", name, nil); err != nil {
return err
}
name = "diskio"
}

Expand Down
5 changes: 5 additions & 0 deletions config/deprecation.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ func (c *Config) collectDeprecationInfo(category, name string, plugin interface{
c.incrementPluginDeprecations(category)
}

// Allow checking for names only.
if plugin == nil {
return info
}

// Check for deprecated options
walkPluginStruct(reflect.ValueOf(plugin), func(field reflect.StructField, value reflect.Value) {
// Try to report only those fields that are set
Expand Down
4 changes: 4 additions & 0 deletions plugins/inputs/deprecations.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ var Deprecations = map[string]telegraf.DeprecationInfo{
Since: "1.7",
Notice: "use 'inputs.jolokia2' with the 'cassandra.conf' example configuration instead",
},
"io": {
Since: "1.20",
Notice: "use 'inputs.diskio' instead",
},
"http_listener_v2": {
Since: "1.9",
Notice: "has been renamed to 'influxdb_listener', use 'inputs.influxdb_listener' or 'inputs.influxdb_listener_v2' instead",
Expand Down

0 comments on commit 82226a9

Please sign in to comment.