Skip to content

processors.rename - weird behaviour in regards to "tags"-option #17500

@knollet

Description

@knollet

Relevant telegraf.conf with rename processor

[[inputs.mock]]    # this input is always the same

  metric_name = "mock"
  [[inputs.mock.constant]]
    name = "constant"
    value = 123

[[processors.rename]]
namepass = ["mock"]
tags = { "test" = "doesnt_work" }     # <-------- doesn't work but no error

Logs from Telegraf

$ telegraf -config tags.conf -test -test-wait 5 -debug
...
> mock,host=myhost constant=123i 1755612972000000000

The tags option seems to exist, though, as I get an error if I try to use an option that doesn't exist:

[[inputs.mock]]    # this input is always the same

  metric_name = "mock"
  [[inputs.mock.constant]]
    name = "constant"
    value = 123

[[processors.rename]]
namepass = ["mock"]
thisdoesntexist = { "test" = "doesnt_work" }     # <------------ error!

output:

$ telegraf -config tags.conf -test -test-wait 5 -debug

2025-08-19T14:20:39Z I! Loading config: tags.conf
2025-08-19T14:20:39Z E! loading config file tags.conf failed: plugin processors.rename: line 8: configuration specified the fields ["thisdoesntexist"], but they were not used; this is either a typo or this config option does not exist in this version

The override-processor behaves as expected, though:

[[inputs.mock]]    # this input is always the same

  metric_name = "mock"
  [[inputs.mock.constant]]
    name = "constant"
    value = 123

[[processors.override]]
namepass = ["mock"]
tags = { "test" = "works" }

output:

$ telegraf -config tags.conf -test -test-wait 5 -debug
...
> mock,host=myhost,test=works constant=123i 1755613379000000000

System info

Telegraf 1.34.4 (git: HEAD@e7ce1e1e), RHEL 9

Steps to reproduce

Use "tags" option with rename-processor.

Expected behavior

Expect that the tags are added to the metric

Actual behavior

Observe that the tags aren't added to the metric

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions