Telegraf error: panic: interface conversion: *metric.trackingMetric is not telegraf.TemplateMetric: missing method Field

Hi,

I’ve been testing a Telegraf conf on a windows environment, where it works fine. Moving to a linux environment in a Podman container (and tidying up minor format differences i.e. folder path fixes) I now get a the below error:

2025-05-20T13:11:14Z I! Loading config: /etc/telegraf/telegraf.conf

*panic: interface conversion: metric.trackingMetric is not telegraf.TemplateMetric: missing method Field

the config file uses inputs.tail, inputs.directorymonitor, processor.starlark, outputs.file & outputs.mqtt plugins. I can get rid of the error by doing any one of the below:

  • commenting out the inputs.tail code
  • commenting out the starlark code that mutates the metric.tag value
  • commenting out the relevant mqtt output plugin

Using Telegraf v1.34 (latest)

My query is how can I resolve this issue. It seems I cant update a tail metric tag in starlark on linux? Is this correct? Haven’t seen much of this issue online so curious if its common or if theres a quick fix for it.

Thanks.