open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.91k stars 2.27k forks source link

[cmd/opampsupervisor]: Refactor NewSupervisor to take a config instead of a filepath #34379

Open BinaryFissionGames opened 1 month ago

BinaryFissionGames commented 1 month ago

Component(s)

cmd/opampsupervisor

Describe the issue you're reporting

The supervisor currently takes in a path to a config file. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/20d6bae9ee577822cc72301d1eea4cfbd909040a/cmd/opampsupervisor/supervisor/supervisor.go#L141

Instead, it should take in a config struct (this config can be read from disk in main). This makes it easier to unit test and easier to use as a library, since the config would not need to be written to disk in order to run the supervisor.

github-actions[bot] commented 1 month ago

Pinging code owners:

crobert-1 commented 1 month ago

Removed needs triage as this makes sense to me, was filed by a code owner, and another code owner responded with +1.