Skip to content

Commit

Permalink
chore(inputs): Remove deprecated options from sample config (#15872)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hipska authored Sep 23, 2024
1 parent 5aa211e commit 0febb7e
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 195 deletions.
5 changes: 0 additions & 5 deletions plugins/inputs/activemq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## ActiveMQ WebConsole URL
url = "http://127.0.0.1:8161"

## Required ActiveMQ Endpoint
## deprecated in 1.11; use the url option
# server = "192.168.50.10"
# port = 8161

## Credentials for basic HTTP authentication
# username = "admin"
# password = "admin"
Expand Down
5 changes: 0 additions & 5 deletions plugins/inputs/activemq/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
## ActiveMQ WebConsole URL
url = "http://127.0.0.1:8161"

## Required ActiveMQ Endpoint
## deprecated in 1.11; use the url option
# server = "192.168.50.10"
# port = 8161

## Credentials for basic HTTP authentication
# username = "admin"
# password = "admin"
Expand Down
9 changes: 8 additions & 1 deletion plugins/inputs/consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/hashicorp/consul/api"

"github.com/influxdata/telegraf"
telegraf_config "github.com/influxdata/telegraf/config"
"github.com/influxdata/telegraf/plugins/common/tls"
"github.com/influxdata/telegraf/plugins/inputs"
)
Expand Down Expand Up @@ -39,7 +40,13 @@ func (*Consul) SampleConfig() string {

func (c *Consul) Init() error {
if c.MetricVersion != 2 {
c.Log.Warnf("Use of deprecated configuration: 'metric_version = 1'; please update to 'metric_version = 2'")
telegraf_config.PrintOptionValueDeprecationNotice("inputs.consul", "metric_version", 1,
telegraf.DeprecationInfo{
Since: "1.16.0",
RemovalIn: "1.40.0",
Notice: `please update to 'metric_version = 2'`,
},
)
}

config := api.DefaultConfig()
Expand Down
13 changes: 0 additions & 13 deletions plugins/inputs/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,11 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## Timeout for docker list, info, and stats commands
timeout = "5s"

## Whether to report for each container per-device blkio (8:0, 8:1...),
## network (eth0, eth1, ...) and cpu (cpu0, cpu1, ...) stats or not.
## Usage of this setting is discouraged since it will be deprecated in favor of 'perdevice_include'.
## Default value is 'true' for backwards compatibility, please set it to 'false' so that 'perdevice_include' setting
## is honored.
perdevice = true

## Specifies for which classes a per-device metric should be issued
## Possible values are 'cpu' (cpu0, cpu1, ...), 'blkio' (8:0, 8:1, ...) and 'network' (eth0, eth1, ...)
## Please note that this setting has no effect if 'perdevice' is set to 'true'
# perdevice_include = ["cpu"]

## Whether to report for each container total blkio and network stats or not.
## Usage of this setting is discouraged since it will be deprecated in favor of 'total_include'.
## Default value is 'false' for backwards compatibility, please set it to 'true' so that 'total_include' setting
## is honored.
total = false

## Specifies for which classes a total metric should be issued. Total is an aggregated of the 'perdevice' values.
## Possible values are 'cpu', 'blkio' and 'network'
## Total 'cpu' is reported directly by Docker daemon, and 'network' and 'blkio' totals are aggregated by this plugin.
Expand Down
13 changes: 0 additions & 13 deletions plugins/inputs/docker/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,11 @@
## Timeout for docker list, info, and stats commands
timeout = "5s"

## Whether to report for each container per-device blkio (8:0, 8:1...),
## network (eth0, eth1, ...) and cpu (cpu0, cpu1, ...) stats or not.
## Usage of this setting is discouraged since it will be deprecated in favor of 'perdevice_include'.
## Default value is 'true' for backwards compatibility, please set it to 'false' so that 'perdevice_include' setting
## is honored.
perdevice = true

## Specifies for which classes a per-device metric should be issued
## Possible values are 'cpu' (cpu0, cpu1, ...), 'blkio' (8:0, 8:1, ...) and 'network' (eth0, eth1, ...)
## Please note that this setting has no effect if 'perdevice' is set to 'true'
# perdevice_include = ["cpu"]

## Whether to report for each container total blkio and network stats or not.
## Usage of this setting is discouraged since it will be deprecated in favor of 'total_include'.
## Default value is 'false' for backwards compatibility, please set it to 'true' so that 'total_include' setting
## is honored.
total = false

## Specifies for which classes a total metric should be issued. Total is an aggregated of the 'perdevice' values.
## Possible values are 'cpu', 'blkio' and 'network'
## Total 'cpu' is reported directly by Docker daemon, and 'network' and 'blkio' totals are aggregated by this plugin.
Expand Down
4 changes: 0 additions & 4 deletions plugins/inputs/elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## HTTP headers to send with each request
# headers = { "X-Custom-Header" = "Custom" }

## Timeout for HTTP requests to the elastic search server(s)
## deprecated in 1.29.0; use 'timeout' instead
http_timeout = "5s"

## When local is true (the default), the node will read only its own stats.
## Set local to false when you want to read the node stats from all nodes
## of the cluster.
Expand Down
4 changes: 0 additions & 4 deletions plugins/inputs/elasticsearch/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
## HTTP headers to send with each request
# headers = { "X-Custom-Header" = "Custom" }

## Timeout for HTTP requests to the elastic search server(s)
## deprecated in 1.29.0; use 'timeout' instead
http_timeout = "5s"

## When local is true (the default), the node will read only its own stats.
## Set local to false when you want to read the node stats from all nodes
## of the cluster.
Expand Down
4 changes: 0 additions & 4 deletions plugins/inputs/influxdb_listener/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## 0 means to use the default of 32MiB.
max_body_size = 0

## Maximum line size allowed to be sent in bytes.
## deprecated in 1.14; parser now handles lines of unlimited length and option is ignored
# max_line_size = 0

## Set one or more allowed client CA certificate file names to
## enable mutually authenticated TLS connections
tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
Expand Down
4 changes: 0 additions & 4 deletions plugins/inputs/influxdb_listener/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
## 0 means to use the default of 32MiB.
max_body_size = 0

## Maximum line size allowed to be sent in bytes.
## deprecated in 1.14; parser now handles lines of unlimited length and option is ignored
# max_line_size = 0

## Set one or more allowed client CA certificate file names to
## enable mutually authenticated TLS connections
tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
Expand Down
12 changes: 1 addition & 11 deletions plugins/inputs/kube_inventory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,9 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## Node name to filter to. No filtering by default.
# node_name = ""

## Use bearer token for authorization. ('bearer_token' takes priority)
##
## Use bearer token for authorization.
## Ignored if url is empty and in-cluster config is used.
##
## If both of these are empty, we'll use the default serviceaccount:
## at: /var/run/secrets/kubernetes.io/serviceaccount/token
##
## To auto-refresh the token, please use a file with the bearer_token option.
## If given a string, Telegraf cannot refresh the token periodically.
# bearer_token = "/var/run/secrets/kubernetes.io/serviceaccount/token"
## OR
## deprecated in 1.24.0; use bearer_token with a file
# bearer_token_string = "abc_123"

## Set response_timeout (default 5 seconds)
# response_timeout = "5s"
Expand Down
12 changes: 1 addition & 11 deletions plugins/inputs/kube_inventory/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,9 @@
## Node name to filter to. No filtering by default.
# node_name = ""

## Use bearer token for authorization. ('bearer_token' takes priority)
##
## Use bearer token for authorization.
## Ignored if url is empty and in-cluster config is used.
##
## If both of these are empty, we'll use the default serviceaccount:
## at: /var/run/secrets/kubernetes.io/serviceaccount/token
##
## To auto-refresh the token, please use a file with the bearer_token option.
## If given a string, Telegraf cannot refresh the token periodically.
# bearer_token = "/var/run/secrets/kubernetes.io/serviceaccount/token"
## OR
## deprecated in 1.24.0; use bearer_token with a file
# bearer_token_string = "abc_123"

## Set response_timeout (default 5 seconds)
# response_timeout = "5s"
Expand Down
8 changes: 2 additions & 6 deletions plugins/inputs/modbus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## INT16, UINT16, INT32, UINT32, INT64, UINT64,
## FLOAT16-IEEE, FLOAT32-IEEE, FLOAT64-IEEE (IEEE 754 binary representation)
## FIXED, UFIXED (fixed-point representation on input)
## FLOAT32 is a deprecated alias for UFIXED for historic reasons, should be avoided
## STRING (byte-sequence converted to string)
## bit - (optional) bit of the register, ONLY valid for BIT type
## scale - the final numeric variable representation
Expand Down Expand Up @@ -407,7 +406,7 @@ This is the original style used by this plugin. It allows a per-register
configuration for a single slave-device.

> [!NOTE]
> _For legacy reasons this configuration style is not completely consistent with the other styles. Especially `FLOAT32` which suggests a floating point representation is actually a_ ___Fixed Point___ _data type and should be considered_ ___deprecated___
> _For legacy reasons this configuration style is not completely consistent with the other styles.
#### Usage of `data_type`

Expand Down Expand Up @@ -440,7 +439,7 @@ modbus data source. For _coil_ and _discrete_ registers only `UINT16` is valid.
Use these types if your modbus registers contain a value that is encoded in this
format. These types always include the sign, therefore no variant exists.

##### Fixed Point: `FIXED`, `UFIXED`, (`FLOAT32` - _deprecated_)
##### Fixed Point: `FIXED`, `UFIXED`

These types are handled as an integer type on input, but are converted to
floating point representation for further processing (e.g. scaling). Use one of
Expand All @@ -456,9 +455,6 @@ Select the type `FIXED` when the input type is declared to hold signed integer
values. Your documentation of the modbus device should indicate this with a term
like 'int32 containing fixed-point representation with N decimal places'.

(`FLOAT32` is deprecated and should not be used. `UFIXED` provides the same
conversion from unsigned values).

##### String: `STRING`

This type is used to query the number of registers specified in the `address`
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/modbus/configuration_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ func (c *ConfigurationOriginal) validateFieldDefinitions(fieldDefs []fieldDefini
func (c *ConfigurationOriginal) normalizeInputDatatype(dataType string, words int) (string, error) {
if dataType == "FLOAT32" {
config.PrintOptionValueDeprecationNotice("input.modbus", "data_type", "FLOAT32", telegraf.DeprecationInfo{
Since: "v1.16.0",
RemovalIn: "v1.35.0",
Since: "1.16.0",
RemovalIn: "1.35.0",
Notice: "Use 'UFIXED' instead",
})
}
Expand Down
1 change: 0 additions & 1 deletion plugins/inputs/modbus/sample_register.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
## INT16, UINT16, INT32, UINT32, INT64, UINT64,
## FLOAT16-IEEE, FLOAT32-IEEE, FLOAT64-IEEE (IEEE 754 binary representation)
## FIXED, UFIXED (fixed-point representation on input)
## FLOAT32 is a deprecated alias for UFIXED for historic reasons, should be avoided
## STRING (byte-sequence converted to string)
## bit - (optional) bit of the register, ONLY valid for BIT type
## scale - the final numeric variable representation
Expand Down
3 changes: 1 addition & 2 deletions plugins/inputs/net/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
## Setting interfaces will tell it to gather these explicit interfaces,
## regardless of status. When specifying an interface, glob-style
## patterns are also supported.
##
# interfaces = ["eth*", "enp0s[0-1]", "lo"]
##

## On linux systems telegraf also collects protocol stats.
## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
##
Expand Down
3 changes: 1 addition & 2 deletions plugins/inputs/net/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
## Setting interfaces will tell it to gather these explicit interfaces,
## regardless of status. When specifying an interface, glob-style
## patterns are also supported.
##
# interfaces = ["eth*", "enp0s[0-1]", "lo"]
##

## On linux systems telegraf also collects protocol stats.
## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
##
Expand Down
3 changes: 0 additions & 3 deletions plugins/inputs/nsq_consumer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
```toml @sample.conf
# Read metrics from NSQD topic(s)
[[inputs.nsq_consumer]]
## Server option still works but is deprecated, we just prepend it to the nsqd array.
# server = "localhost:4150"

## An array representing the NSQD TCP HTTP Endpoints
nsqd = ["localhost:4150"]

Expand Down
24 changes: 14 additions & 10 deletions plugins/inputs/nsq_consumer/nsq_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ func (*NSQConsumer) SampleConfig() string {
return sampleConfig
}

func (n *NSQConsumer) Init() error {
// For backward compatibility
if n.Server != "" {
n.Nsqd = append(n.Nsqd, n.Server)
}

// Check if we have anything to connect to
if len(n.Nsqlookupd) == 0 && len(n.Nsqd) == 0 {
return errors.New("either 'nsqd' or 'nsqlookupd' needs to be specified")
}

return nil
}

// SetParser takes the data_format from the config and finds the right parser for that format
func (n *NSQConsumer) SetParser(parser telegraf.Parser) {
n.parser = parser
Expand Down Expand Up @@ -104,16 +118,6 @@ func (n *NSQConsumer) Start(ac telegraf.Accumulator) error {
return nil
}))

// For backward compatibility
if n.Server != "" {
n.Nsqd = append(n.Nsqd, n.Server)
}

// Check if we have anything to connect to
if len(n.Nsqlookupd) == 0 && len(n.Nsqd) == 0 {
return errors.New("either 'nsqd' or 'nsqlookupd' needs to be specified")
}

if len(n.Nsqlookupd) > 0 {
err := n.consumer.ConnectToNSQLookupds(n.Nsqlookupd)
if err != nil && !errors.Is(err, nsq.ErrAlreadyConnected) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/nsq_consumer/nsq_consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ func TestReadsMetricsFromNSQ(t *testing.T) {

consumer := &NSQConsumer{
Log: testutil.Logger{},
Server: "127.0.0.1:4155",
Topic: "telegraf",
Channel: "consume",
MaxInFlight: 1,
MaxUndeliveredMessages: defaultMaxUndeliveredMessages,
Nsqd: []string{"127.0.0.1:4155"},
}
require.NoError(t, consumer.Init())

p := &influx.Parser{}
require.NoError(t, p.Init())
Expand Down
3 changes: 0 additions & 3 deletions plugins/inputs/nsq_consumer/sample.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Read metrics from NSQD topic(s)
[[inputs.nsq_consumer]]
## Server option still works but is deprecated, we just prepend it to the nsqd array.
# server = "localhost:4150"

## An array representing the NSQD TCP HTTP Endpoints
nsqd = ["localhost:4150"]

Expand Down
2 changes: 0 additions & 2 deletions plugins/inputs/opcua/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,12 @@ to use them.
## namespace - OPC UA namespace of the node (integer value 0 thru 3)
## identifier_type - OPC UA ID type (s=string, i=numeric, g=guid, b=opaque)
## identifier - OPC UA ID (tag as shown in opcua browser)
## tags - extra tags to be added to the output metric (optional); deprecated in 1.25.0; use default_tags
## default_tags - extra tags to be added to the output metric (optional)
##
## Use either the inline notation or the bracketed notation, not both.
#
## Inline notation (default_tags not supported yet)
# nodes = [
# {name="", namespace="", identifier_type="", identifier="", tags=[["tag1", "value1"], ["tag2", "value2"]},
# {name="", namespace="", identifier_type="", identifier=""},
# ]
#
Expand Down
2 changes: 0 additions & 2 deletions plugins/inputs/opcua/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@
## namespace - OPC UA namespace of the node (integer value 0 thru 3)
## identifier_type - OPC UA ID type (s=string, i=numeric, g=guid, b=opaque)
## identifier - OPC UA ID (tag as shown in opcua browser)
## tags - extra tags to be added to the output metric (optional); deprecated in 1.25.0; use default_tags
## default_tags - extra tags to be added to the output metric (optional)
##
## Use either the inline notation or the bracketed notation, not both.
#
## Inline notation (default_tags not supported yet)
# nodes = [
# {name="", namespace="", identifier_type="", identifier="", tags=[["tag1", "value1"], ["tag2", "value2"]},
# {name="", namespace="", identifier_type="", identifier=""},
# ]
#
Expand Down
6 changes: 1 addition & 5 deletions plugins/inputs/postgresql_extensible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ to use them.
#
address = "host=localhost user=postgres sslmode=disable"

## A list of databases to pull metrics about.
## deprecated in 1.22.3; use the sqlquery option to specify database to use
# databases = ["app_production", "testing"]

## Whether to use prepared statements when connecting to the database.
## This should be set to false when connecting through a PgBouncer instance
## with pool_mode set to transaction.
Expand Down Expand Up @@ -93,7 +89,7 @@ to use them.
# timestamp string
[[inputs.postgresql_extensible.query]]
measurement="pg_stat_database"
sqlquery="SELECT * FROM pg_stat_database where datname"
sqlquery="SELECT * FROM pg_stat_database WHERE datname"
min_version=901
tagvalue=""
[[inputs.postgresql_extensible.query]]
Expand Down
Loading

0 comments on commit 0febb7e

Please sign in to comment.