Skip to content

outputs.influxdb_v3: timeout config option broken due to TOML tag collision with embedded HTTPClientConfig #18502

@lumaks-redox

Description

@lumaks-redox

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

  1. Configure outputs.influxdb_v3 with timeout = "5s" (or any value)
  2. 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:

  1. Remove the Timeout field from clientConfig and rely on the embedded HTTPClientConfig.Timeout (since both serve the same purpose)
  2. Or rename the TOML tag on clientConfig.Timeout to 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions