Allow reading apm config from file in ESS deployments #5899
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.
What does this PR do?
This PR preserves the
agent.monitoring.apm.*
settings when the agent is managed and in fleet bootstrap mode (as it is in an ESS deployment)PatchAPMConfig
is initialized before fleet config is merged onto the file config.MonitoringAPMConfig
is preserved when loading the persistent configurationelastic-agent.yml
is not rotated if it already containsfleet.enabled=true
(similar to what has been done in Add disable providers by default option #4166, although I didn't manage to make it work on the8.16
branch where I tested spinning up ESS deployments with custom agent images) so I implemented a simpler solution heredebug
or removed altogether (to figure out what was going on I had to dump part of the configuration in multiple places)Why is it important?
Allow elastic-agent running fleet-server and apm-server in ESS integration server to propagate APM settings coming from
elastic-agent.yml
without the need of replicating such configuration in Fleet Cloud policy.Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
How to test this PR locally
Related issues
Questions to ask yourself