Skip to content

[cmd/opampsupervisor] Add support for "base layer" local config for the Collector #39963

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
douglascamata opened this issue May 9, 2025 · 3 comments
Labels
cmd/opampsupervisor enhancement New feature or request needs triage New item requiring triage

Comments

@douglascamata
Copy link
Contributor

Component(s)

cmd/opampsupervisor

Is your feature request related to a problem? Please describe.

I want to provide a base configuration, that can be overwritten by any other configuration source (the current local configuration implement is final and not overwrite-able), that the Supervisor can use to start the Collector without having to interact with any OpAMP backend to get remote configuration.

Describe the solution you'd like

We already got local configuration (proposed in #37886, implemented in #38671) support in the Supervisor's agent.config_files. These files are merged last into all other configuration, making it impossible to overwrite any configuration they do.

While enforcement of certain configuration above everything else is a very valid use case, I would like to propose that we also another use case: local configuration that can be used as a "base layer" on which to merge everything else.

It could be configured like this:

agent:
  base_config_files:
    - starting_config.yaml
  config_files: 
    - enforced_config.yaml

And I believe this "base config" should have the lowest priority in merging. In other words, it should be the very first to be merged into the config.

Describe alternatives you've considered

No response

Additional context

No response

@douglascamata douglascamata added enhancement New feature or request needs triage New item requiring triage labels May 9, 2025
Copy link
Contributor

github-actions bot commented May 9, 2025

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@tigrannajaryan
Copy link
Member

I understand the use case, but I wonder if there is a way to design this differently so that it is easier to understand by the end users and harder to misuse. The proposed approach requires the user to read the docs and understand the merging order, which already is not easy and becomes even more complicated.

@douglascamata
Copy link
Contributor Author

@tigrannajaryan that's already a problem we have today (see #39931, for instance) and one that I don't think will ever be avoided (but we can handle it better). We need very good documentation and logs regarding configuration merging. If possible we could also add this to the specification.

Part of the improvement I believe is better naming. That's why I propose the name base_config_files for this new configuration. I think it communicates well what it does and it's low priority. It could also be named low_priority_config_files.

The name config_files is bad in comparison, because it doesn't give you any clue about the priority of these configuration files. I would rather rename it to enforced_config_files, critical_config_files, top_level_config_files, high_priority_config_files, or something else on these lines that clearly communicates it overrides everything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/opampsupervisor enhancement New feature or request needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

2 participants