[8.19] (backport #10819) Always run the otel collector self-monitoring input in the otel runtime #10827
+8
−2
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?
Makes the prometheus metrics input we use to collect otel collector metrics always run inside said otel collector, even if the user configures self-monitoring to run in beats processes.
Why is it important?
This input can't run in a beats process because it requires an environment variable which we only set for the otel collector. Fixing this properly would require significant additional work, and we're planning to collect these metrics in a much more robust way in 9.3.
Checklist
- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration files- [ ] I have added an entry in./changelog/fragmentsusing the changelog tool- [ ] I have added an integration test or an E2E testHow to test this PR locally
Build the agent locally and run it with self-monitoring in process mode and an input in otel mode. For example:
Then check status. There should be a prometheus/metrics-monitoring component running as a beat receiver:
{ "id": "prometheus/metrics-monitoring", "name": "prometheus/metrics", "state": 2, "message": "HEALTHY", "units": [ { "unit_id": "prometheus/metrics-monitoring", "unit_type": 1, "state": 2, "message": "Healthy" }, { "unit_id": "prometheus/metrics-monitoring-metrics-monitoring-collector", "unit_type": 0, "state": 2, "message": "Healthy", "payload": { "streams": { "metrics-monitoring-collector": { "error": "", "status": "HEALTHY" } } } } ], "version_info": { "name": "beats-receiver", "meta": { "build_time": "2025-10-24 17:36:57 +0000 UTC", "commit": "66155e4093dcf38ab0e446f83f40ca449c73eb10" } } }Related issues
This is an automatic backport of pull request #10819 done by [Mergify](https://mergify.com).