[cmd/opampsupervisor] fix: Report RemoteConfigStatus on startup if present #40233
+58
−3
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.
Description
The OpAMP Client
StartSettings
include an initial RemoteConfigStatus that can be reported on startup. In the event it is unset/nil, OpAMP servers will respond with a RemoteConfig message to the supervisor. However, when the supervisor receives this message and it's the same config it is already running the collector with, it has nothing to do so it drops the message. This causes the OpAMP server to continually send more RemoteConfig messages because the supervisor hasn't reported a status since startup.This PR sets this initial RemoteConfigStatus if we have one present. Made a slight refactor to how we load the initial config. Pulled out the remote config loading into it's own function that is called during the client start. This has no affect on the config loading.
Link to tracking issue
Fixes
Testing
Updated an e2e test testing supervisor&collector start up when there's a remote config present to also check the remote config message that is sent.
Documentation