influxdata / influxdata/helm-charts
Does the Telegraf chart need list value defaults for inputs, outputs, and processors?
- Dominant language
- Mustache
- Stars
- 257
- Forks
- 347
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
Hi, I've noticed that the chart for Telegraf includes some default values for inputs, outputs, and processors, e.g.:
https://github.com/influxdata/helm-charts/blob/10fdfe98005d67df5662f40a1ef6db6099ea5e03/charts/telegraf/values.yaml#L147-L151
However, we would like to be able to specify these as maps instead of lists. For example, we may want to have default values for a given output and then be able to override them per environment. If we specify this as a list, then we have to manually supply a full configuration for each environment. This can get really error prone and burdensome across multiple environments with multiple developers.
It seems like the configuration _can_ be specified as a map (which would make sense given the `range` function in Go/Helm) but we constantly get warnings like this when using a map:
```sh
coalesce.go:301: warning: destination for telegraf.telegraf.config.inputs is a table. Ignoring non-table value ([map[statsd:map[allowed_pending_messages:10000 metric_separator:_ percentile_limit:1000 percentiles:[50 95 99] service_address::8125]]])
coalesce.go:301: warning: destination for telegraf.telegraf.config.outputs is a table. Ignoring non-table value ([map[influxdb:map[database:telegraf urls:[http://influxdb.monitoring.svc:8086]]]])
coalesce.go:301: warning: destination for telegraf.telegraf.config.inputs is a table. Ignoring non-table value ([map[statsd:map[allowed_pending_messages:10000 metric_separator:_ percentile_limit:1000 percentiles:[50 95 99] service_address::8125]]])
coalesce.go:301: warning: destination for telegraf.telegraf.config.outputs is a table. Ignoring non-table value ([map[influxdb:map[database:telegraf urls:[http://influxdb.monitoring.svc:8086]]]])
coalesce.go:301: warning: destination for telegraf.telegraf.config.inputs is a table. Ignoring non-table value ([map[statsd:map[allowed_pending_messages:10000 metric_separator:_ percentile_limit:1000 percentiles:[50 95 99] service_address::8125]]])
coalesce.go:301: warning: destination for telegraf.telegraf.config.outputs is a table. Ignoring non-table value ([map[influxdb:map[database:telegraf urls:[http://influxdb.monitoring.svc:8086]]]])
```
This is probably due to trying to merge a map into a list - the list values end up being discarded. And while this is fine for now, we're wondering what potential changes to Go/Helm could cause problems in the future when trying this operation.
Any chance that inputs/outputs/processors could _not_ have a list as a default specified? The ones in there right now don't seem to make sense anyway.
Contributor guide
Research direction
Start with charts/telegraf/values.yaml at the referenced inputs, outputs, and processors defaults, then inspect the chart templates that range over telegraf.config. Verify how Helm coalesces map and list values. Done means map-based overrides work without the reported warnings and the existing chart configuration remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100