Skip to content

Switch to otel self-monitoring by default#10594

Merged
cmacknz merged 3 commits intomainfrom
feat/self-monitoring-otel-default-alternative
Oct 28, 2025
Merged

Switch to otel self-monitoring by default#10594
cmacknz merged 3 commits intomainfrom
feat/self-monitoring-otel-default-alternative

Conversation

@swiatekm
Copy link
Contributor

@swiatekm swiatekm commented Oct 15, 2025

What does this PR do?

Switches Elastic Agent self-monitoring to use the otel runtime by default. The self-monitoring components will run as receivers within a managed otel collector, rather than individual processes.

Why is it important?

This is the first step in an effort to give a similar treatment to all inputs. The benefit of this will be improved resource efficiency and compatibility with the otel universe.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Disruptive User Impact

There should be no user-facing impact, other than reduced resource consumption. If there is one, this change can be reversed by setting agent.monitoring._runtime_experimental: process.

How to test this PR locally

Build agent and run it with the default configuration. You should see an otel collector process, and the self-monitoring inputs should be listed in status as beats-receiver.

Related issues

@mergify
Copy link
Contributor

mergify bot commented Oct 15, 2025

This pull request does not have a backport label. Could you fix it @swiatekm? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label that automatically backports to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.
@mergify
Copy link
Contributor

mergify bot commented Oct 15, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feat/self-monitoring-otel-default-alternative upstream/feat/self-monitoring-otel-default-alternative
git merge upstream/main
git push upstream feat/self-monitoring-otel-default-alternative
@swiatekm swiatekm force-pushed the feat/self-monitoring-otel-default-alternative branch 4 times, most recently from 292908a to 1722db1 Compare October 20, 2025 14:21
@swiatekm swiatekm force-pushed the feat/self-monitoring-otel-default-alternative branch 2 times, most recently from faa852e to df78f0c Compare October 28, 2025 14:14
# Conflicts:
#	internal/pkg/agent/application/monitoring/component/v1_monitor_test.go
@swiatekm swiatekm force-pushed the feat/self-monitoring-otel-default-alternative branch from df78f0c to fdfda2b Compare October 28, 2025 15:55
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @swiatekm

@swiatekm swiatekm changed the title WIP: Switch to otel self-monitoring by default Oct 28, 2025
@swiatekm swiatekm added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team enhancement New feature or request labels Oct 28, 2025
@swiatekm swiatekm marked this pull request as ready for review October 28, 2025 18:44
@swiatekm swiatekm requested a review from a team as a code owner October 28, 2025 18:44
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@cmacknz cmacknz merged commit 79931dd into main Oct 28, 2025
25 checks passed
@cmacknz cmacknz deleted the feat/self-monitoring-otel-default-alternative branch October 28, 2025 19:18
@cmacknz
Copy link
Member

cmacknz commented Oct 31, 2025

Creating the 9.2 backport now that we are unblocked.

mergify bot pushed a commit that referenced this pull request Oct 31, 2025
* Switch to the otel runtime manager by default for self-monitoring

* Update monitoring tests

# Conflicts:
#	internal/pkg/agent/application/monitoring/component/v1_monitor_test.go

* Add changelog entry

(cherry picked from commit 79931dd)
ebeahan pushed a commit that referenced this pull request Oct 31, 2025
* Switch to the otel runtime manager by default for self-monitoring

* Update monitoring tests

# Conflicts:
#	internal/pkg/agent/application/monitoring/component/v1_monitor_test.go

* Add changelog entry

(cherry picked from commit 79931dd)

Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com>
hayotbisonai pushed a commit to hayotbisonai/elastic-agent that referenced this pull request Nov 23, 2025
* Switch to the otel runtime manager by default for self-monitoring

* Update monitoring tests

# Conflicts:
#	internal/pkg/agent/application/monitoring/component/v1_monitor_test.go

* Add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.2 Automated backport to the 9.2 branch enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

3 participants