Telegraf errors with non-nonsensical line number and message

I’m running telegraph 1.25.0 on rPis using RaspberryPi OS (bullseye) and without any changes to config files, except upgrade from 1.24 to 1.25 I’m suddenly getting the following error:

> /usr/bin/telegraf --config /etc/telegraf/telegraf.conf --config-direc
tory /etc/telegraf/telegraf.d --test
2023-01-05T19:16:31Z E! [telegraf] Error running agent: error loading config file /etc/telegraf/telegraf.conf: plugin inputs.socketstat: line 123: configuration specified the fields ["socket_types"], but they weren't used

So far so good, except that:

> tail +120 /etc/telegraf/telegraf.conf | head -n 10

# Read metrics about cpu usage
  ## Whether to report per-cpu stats or not
  percpu = false
  ## Whether to report total system cpu stats or not
  totalcpu = true
  ## If true, collect raw CPU time metrics
  collect_cpu_time = false

But I do use socketstat:

> egrep -n socketstat /etc/telegraf/telegraf.conf

Line 123 vs. 546?
Also I don’t see what’s wrong with the config:

> tail +538 /etc/telegraf/telegraf.conf | head -n 20
  cgroup = "system.slice/caddy.service"
  pid_finder = "native"
  fieldpass = ["cpu_time_*", "memory_*", "*_usage"]
  tagexclude = ["cgroup_full", "user"]

# Gather indicators from established connections, using iproute2's ss command.
  ## ss can display information about tcp, udp, raw, unix, packet, dccp and sctp sockets
  ## Specify here the types you want to gather
  socket_types = [ "tcp", "udp" ]
  ## The default timeout of 1s for ss execution can be overridden here:
  # timeout = "1s"

# Gather systemd units state
  ## Set timeout for systemctl execution
  # timeout = "1s"

I’m failing to see what’s wrong there, perhaps have been staring at it for too long and don’t see the obvious?

The full config file is available at (I’m not allowed to upload here)

Appreciate any help! Thanks!

Update: the problem manifests itself with 1.24.3, 1.24.4, and 1.25.0. Everything works normally using 1.24.2. Packages pulled from:
Get:1 stable/main armhf telegraf armhf 1.24.2-1 [39.6 MB]

No idea why the weird line number, however the real reason is that the socketstat plugin does not recognize any “socket_types” option. The real name for the value is protocols seen here.

Looks like it has been this way since it was very first added feat: socketstat input plugin (#3649) · influxdata/telegraf@911c0a9 · GitHub as well!

Thanks for spotting the issue!! I hadn’t looked at the source code… Looks like the readme has been wrong since inception: feat: socketstat input plugin by sajoupa · Pull Request #3649 · influxdata/telegraf · GitHub

Would you be willing to file a bug? I would really appreciate it!