Skip to content

New subcommand for dumping configs #11479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
VihasMakwana opened this issue Oct 17, 2024 · 1 comment
Open

New subcommand for dumping configs #11479

VihasMakwana opened this issue Oct 17, 2024 · 1 comment
Assignees

Comments

@VihasMakwana
Copy link
Contributor

This is a sub-issue created from #5223.

Is your feature request related to a problem? Please describe.
It would make sense to have a command line option which logs the final configuration. It is particularly useful for users when a config is created from multiple providers and expanded recursively.

Describe the solution you'd like
This option can be provided as a subcommand (like validate subcommand). This new subcommand would be helpful for introspection the configuration.

  • Why a new subcommand?
    • Users should be able to view the config for debugging purposes, even if that config is invalid.

Additional context
I've got couple of suggestions for subcommand's name:

  • inspect
  • probe
  • examine

From #5223 (comment),

I propose following:

  • Enhance the validate subcommand with the --dump-config option, which will display the configuration after it has been resolved/expanded/merged from different sources.
  • Add another option as a follow-up PR, --dump-mode, which will show both the configuration after resolving/expanding and the configuration after applying default settings.

This issue caters the first requirement.
As suggested by @mx-psi here, we should take a different approach for second requirement i.e. a new extension which exposes config over http and which can watch for runtime config updates.

@mx-psi
Copy link
Member

mx-psi commented Oct 17, 2024

Assigned to you @VihasMakwana! I think we can make a PR directly and discuss the specifics there :)

github-merge-queue bot pushed a commit that referenced this issue Feb 20, 2025
…11775)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

**_Why is this useful?_**
- Users might want to examine the config if they face any errors at boot
time. This subcommand prints the configuration on stdout after merging
and resolving from all the `--config` sources.
- The command prints the configuration even if it's invalid. This can
help user to track down the faulty piece of config.

**_Usage_**

```bash
./otelcorecol examine --config=file:file.yaml --config=http://remote:8080/config --config=file:file2.yaml
```

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes
##11479

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added unit test cases.

<!--Describe the documentation added.-->
#### Documentation
Updated readme.
<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
Co-authored-by: Pablo Baeyens <[email protected]>
Co-authored-by: Pablo Baeyens <[email protected]>
Co-authored-by: Evan Bradley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants