Add separate print commands for initial and validated configuration #13278
+593
−172
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 introduces two distinct print commands to provide different views of the OpenTelemetry Collector configuration:
In my opinion, the
print-initial-config
command is dangerous because it prints a raw configuration object asmap[string]string
instead of printing the structured object with its correct configuration type. I would advocate to remove this feature instead of finishing the feature gate because it allows printing redacted strings.The new command parses the configuration using the correct type, then prints it but does not validate it. It will be useful for a user to both debug validation problems and to see the exact configuration a component is using, by default, after configuration has been applied.
New/Modified Commands:
Both commands support --format flag with yaml and json options:
Documented, tested.