[telegraf] optional alternative config templates #441
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds alternative config templates for
aggregators
,processors
,inputs
andoutputs
.There have been a few issues so far where existing templates fail to render valid configuration elements (#433, #429, #375, #119, #111 etc). Existing templates are written with nesting that attempts to match generated output (especially for
inputs
), but it is insufficient and becomes difficult to maintain.The new set of templates use one common recursive template that handles nesting without limits. The feature can be activated by setting
tplVersion
to2
(either via--set
helm option or as an entry in values file).Config examples from the above mentioned issues are all together in
charts/telegraf/ci/complex-values.yaml
file and have been tested. The resulting telegraf.conf is valid and Telegraf runs with it.Hopefully the new templates will support greater variety of yaml configs than existing templates. It may reduce the need to have an option to specify raw config (#358). But why not have both.
--
There is also a small amendment to workflow in this PR: after charts are tested (with success), logs are checked for messages that represent severe errors. In case of telegraf chart, when config file is invalid and Telegraf actually fails to start,
ct install
check result is success nevertheless.