[OpAMP] Sending updated effective config after remote config is applied#2904
Conversation
Test improved
# Conflicts: # opamp/src/main/java/com/splunk/opentelemetry/opamp/RemoteConfigProcessor.java # opamp/src/main/java/com/splunk/opentelemetry/opamp/effectiveconfig/EnvVarsEffectiveConfigFileFactory.java
| return new EffectiveConfigReporter(createEffectiveConfigFactory(sdk), effectiveConfigState); | ||
| } | ||
|
|
||
| public boolean reportEffectiveConfigIfChanged() { |
There was a problem hiding this comment.
[for reviewer] It is the most basic approach, but is good enough for now. Effective config is recreated every time and compared with the one most recently reported. If identical then it is not sent again.
|
|
||
| ProfilerConfiguration updatedProfilerConfig = | ||
| ProfilerConfiguration.SUPPLIER.get().toBuilder() | ||
| .setEnabled(receivedProfilerConfig.isEnabled()) |
There was a problem hiding this comment.
[for reviewer] Next configurable properties will go here
| .build(); | ||
| ProfilerConfiguration.SUPPLIER.configure(updatedProfilerConfig); | ||
|
|
||
| if (updatedProfilerConfig.isEnabled()) { |
There was a problem hiding this comment.
[for reviewer] It will change in next PR, so other properties can be supported
|
Tick the box to add this pull request to the merge queue (same as
|
|
|
||
| public void set(AgentConfigMap configMap) { | ||
| agentConfigMap = configMap; | ||
| notifyUpdate(); |
There was a problem hiding this comment.
[for reviewer] Automatically trigger sending message to the server with this state.
| .last_remote_config_hash(remoteConfig.config_hash) | ||
| .status(RemoteConfigStatuses.RemoteConfigStatuses_APPLIED) | ||
| .build()); | ||
| // TODO: Maybe should be postponed after profiler is enabled/disabled? |
There was a problem hiding this comment.
Right, will be done in one of the following PRs
Effective config is now reported if profiler configuration changed.