open-telemetry / opentelemetry-collector-contrib

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

[cmd/opampsupervisor] Implement collector executable updates #33947

Open BinaryFissionGames opened 2 weeks ago

BinaryFissionGames commented 2 weeks ago

Component(s)

cmd/opampsupervisor

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

This issue is for implementing the "Collector Executable Updates" section of the supervisor spec.

Describe the solution you'd like

See spec for a description of the behavior:

Collector Executable Updates

Note: this capability must be manually enabled by the user via the AcceptsPackages setting in the supervisor config file and is disabled by default.

This capability should be only implemented after we introduce the code signing process for the Collector and all released Collector executables are signed, the Supervisor is capable of verifying the signature of executables and other OpAMP security recommendations are followed.

The Supervisor will download Collector package updates when offered so by the Backend. The Supervisor will verify the integrity of the packages and will install them. This requires stopping the Collector, overwriting the Collector executable file with the newly downloaded version and starting the Collector. Before overwriting the executable the Supervisor will save it in case it is necessary for reverting.

If after the restart the Collector does not become healthy the Supervisor will revert the update, by stopping the Collector, reverting the Collector executable file and starting the Collector again. The failed update attempt will be reported to the Backend and the failed Collector package version will be marked as "bad" to avoid trying it again even if offered by the Backend.

Note: cached local config must be invalidated after executable updates to make sure a fresh AgentDescription is obtained by the Supervisor on the next Collector start (at the minimum the version number to be included in AgentDescription is expected to change after the executable is updated).

Describe alternatives you've considered

No response

Additional context

No response

github-actions[bot] commented 2 weeks ago

Pinging code owners: