influxdata / helm-charts

Official Helm Chart Repository for InfluxData Applications
MIT License
233 stars 330 forks source link

[telegraf-ds] Single bracket for single element in map list interface #664

Open nicolas-rey opened 3 months ago

nicolas-rey commented 3 months ago

Telegraf-ds Helm chart version: 1.1.32 Telegraf Docker image 1.29-alpine Amazon Linux on EKS

I'm trying to put processors.converter in telegraf-ds configuration.

On this processors I want to convert tags to fields, for exemple the expected config will be :

[[processors.converter]]
  namepass = ["ping"]
  [processors.converter.tags]
    string = [
      "host",
      "name",
      "url"
    ]

For this, configuration on YAML for telegraf-ds is:

config:
 # [...]
  inputs:
  processors:
    - converter:
        namepass:
          - ping
        tags:
          string:
            - host
            - name
            - url

With the actual template for telegraf-ds the result is :

[[processors.converter]]
  namepass = ["ping"]
  [[processors.converter.tags]]
    string = [
      "host"
      "name",
      "url"
    ]

Two problems here:

  1. processors.converter.tags have two bracket and not one (https://github.com/influxdata/helm-charts/blob/telegraf-ds-1.1.32/charts/telegraf-ds/templates/_helpers.tpl#L228)
  2. first element of string list don't have comma

I've check on telegraf template and it's good. An If statement is in place for used single bracket with converter, override, clone and two brackets for other (https://github.com/influxdata/helm-charts/blob/telegraf-1.8.51/charts/telegraf/templates/_helpers.tpl#L342)

After check all templates and part, 3 syntaxe is present for manage map string interface :


Can you used one if statement on processors in telegraf-ds for allow processors.converter ?