Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template processor error when using the name of the metric in the template #7257

Closed
pedrotambo opened this issue Mar 30, 2020 · 0 comments · Fixed by #7258
Closed

Template processor error when using the name of the metric in the template #7257

pedrotambo opened this issue Mar 30, 2020 · 0 comments · Fixed by #7258
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@pedrotambo
Copy link

Relevant telegraf.conf:

[[processors.template]]
  tag = "measurement"
  template = '{{ .Name }}'

System info:

Docker image telegraf:1.14

Steps to reproduce:

  1. Add the configuration in telegraf.
  2. Run the container.

Expected behavior:

Metrics are sent with a new tag called "measurement" and the value is the name of the metric.

Actual behavior:

The metrics are sent wihtout the new tag.

Additional info:

Error from the logs:
telegraf-forwarder_1 | 2020-03-30T22:40:20Z E! [processors.template] failed to execute template: template: configured_template:1:3: executing "configured_template" at <.Name>: can't evaluate field Name in type *template.TemplateMetric

@danielnelson danielnelson added this to the 1.14.1 milestone Mar 31, 2020
@danielnelson danielnelson self-assigned this Mar 31, 2020
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants