-
Notifications
You must be signed in to change notification settings - Fork 5.8k
outputs.influxdb_v3: timeout config option broken due to TOML tag collision with embedded HTTPClientConfig #18502
Description
Relevant telegraf.conf
[[outputs.influxdb_v3]]
urls = ["http://influxdb3.monitoring.svc.cluster.local:8181"]
database = "test"
timeout = "120s"
content_encoding = "gzip"Logs from Telegraf
2026-03-10T15:51:46Z E! loading config file /etc/telegraf/telegraf.conf failed: error parsing influxdb_v3 array, line 43: field corresponding to `timeout' in influxdb_v3.InfluxDB cannot be set through TOML
System info
Telegraf 1.38.0-alpine (Docker image), running on Kubernetes (EKS).
Docker
telegraf:1.38.0-alpine
Steps to reproduce
- Configure
outputs.influxdb_v3withtimeout = "5s"(or any value) - Start Telegraf
Expected behavior
Telegraf starts successfully and uses the configured timeout value for HTTP requests.
Actual behavior
Telegraf fails to start with the error: field corresponding to 'timeout' in influxdb_v3.InfluxDB cannot be set through TOML
Root cause analysis
The clientConfig struct in plugins/outputs/influxdb_v3/influxdb_v3.go has a Timeout field with toml:"timeout":
type clientConfig struct {
// ...
Timeout config.Duration `toml:"timeout"`
common_http.HTTPClientConfig
// ...
}The embedded HTTPClientConfig in plugins/common/http/config.go also has a Timeout field with the same TOML tag:
type HTTPClientConfig struct {
Timeout config.Duration `toml:"timeout"`
TransportConfig
// ...
}This creates a TOML tag collision. The TOML parser finds two fields matching timeout and refuses to set either, making the timeout config option unusable.
Note that sample.conf documents timeout as a valid option (# timeout = "5s"), which is misleading since it cannot actually be set.
Workaround
Use response_timeout instead, which lives on TransportConfig (no collision):
[[outputs.influxdb_v3]]
urls = ["http://localhost:8181"]
database = "mydb"
response_timeout = "120s"Note: response_timeout controls the HTTP response header timeout (TransportConfig.ResponseHeaderTimeout), not the overall HTTP client timeout (HTTPClientConfig.Timeout). Functionally similar for most use cases but semantically different.
Suggested fix
Either:
- Remove the
Timeoutfield fromclientConfigand rely on the embeddedHTTPClientConfig.Timeout(since both serve the same purpose) - Or rename the TOML tag on
clientConfig.Timeoutto something unique (e.g.,toml:"write_timeout")
Option 1 is cleaner since other output plugins (e.g., influxdb_v2) don't duplicate this field and just use the embedded HTTPClientConfig.Timeout directly.