[8.19] (backport #10003) feat: emit system resource metrics for EDOT subprocess #10142
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 introduces support for emitting system resource metrics for the EDOT (Elastic Distribution of OpenTelemetry) collector when it runs as a subprocess of the Elastic Agent.
Key changes:
features.agent.otel.subprocess_execution
feature flag to control whether the OTel collector runs in subprocess execution mode.false
for now (maintaining existing behaviour), but is expected to default totrue
in the imminent future.elastic-agent/collector
, capturing only its system resources usage.OTelManager
construction to honor the execution mode parsed from the feature flags, rather than always running in embedded mode.Why is it important?
Running the collector as a subprocess improves resilience by isolating the control plane from the data plane. Emitting metrics for the EDOT process ensures operational visibility, allowing users to observe and troubleshoot its resource usage independently from the main Elastic Agent process.
Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
No disruptive impact expected.
features.agent.otel.subprocess_execution
isfalse
(default), behavior is unchanged.elastic-agent/collector
.How to test this PR locally
elastic-agent.yml
:Related issues
N/A
This is an automatic backport of pull request #10003 done by [Mergify](https://mergify.com).