Pre-configure telegraf's internal input plugin #45
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.
Resolves
https://jira.rax.io/browse/SALUS-467
What
Telegraf provides an
internal
input plugin which provides self-monitoring metrics. That is a good one to auto-configure to provide some baseline data and liveness info about the telegraf agent even before the user has configured any monitors.How
Since this changes (and simplifies) the "ready to run telegraf" condition, the logic has been tweaked to always ensure the main telegraf config file is written, the
config.d
directory is present, but does not need to contain any config files. The latter used to be a precondition since telegraf would error out if no input plugins were configured -- now we guarantee at least one input plugin is always configured.I also changed the purge config logic slightly to ensure that a new main telegraf config file is written at least once per envoy startup. Otherwise, we didn't have a way to ensure the latest and greatest config file was re-written as we add features like this.
How to test
Existing unit tests and manually verified by inspecting the initial startup sequence: