Skip to content

Apply default processors to events from the monitoring receiver#12717

Merged
faec merged 13 commits intoelastic:mainfrom
faec:processors-for-otel-monitoring
Feb 18, 2026
Merged

Apply default processors to events from the monitoring receiver#12717
faec merged 13 commits intoelastic:mainfrom
faec:processors-for-otel-monitoring

Conversation

@faec
Copy link
Contributor

@faec faec commented Feb 11, 2026

Include the beat processor in the OTel Collector and use it to apply default processors (most notably add_host_metadata) to monitoring events generated by collector internal telemetry. See #12577

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

How to test this PR locally

With this PR, any ingested monitoring metrics with component.id of elasticsearch-default or elasticsearch-monitoring should include the fields from standard processors, most notably the hostname.

@faec faec self-assigned this Feb 11, 2026
@faec faec added bug Something isn't working Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Feb 11, 2026
@mergify
Copy link
Contributor

mergify bot commented Feb 11, 2026

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 processors-for-otel-monitoring upstream/processors-for-otel-monitoring
git merge upstream/main
git push upstream processors-for-otel-monitoring
@mergify
Copy link
Contributor

mergify bot commented Feb 11, 2026

This pull request does not have a backport label. Could you fix it @faec? 🙏
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.
@faec faec marked this pull request as ready for review February 12, 2026 19:14
@faec faec requested a review from a team as a code owner February 12, 2026 19:14
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@faec faec requested a review from andrzej-stencel February 12, 2026 19:14
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Feb 13, 2026
@elasticmachine
Copy link
Contributor

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

@mauri870
Copy link
Member

mauri870 commented Feb 13, 2026

Can we have a test for this? Ideally you could change one of the TestMonitoringReceiver (integration) to assert some fields are present.

Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that an integration test should check this.

@faec
Copy link
Contributor Author

faec commented Feb 13, 2026

@mauri870 I couldn't find a practical way to do an integration test that used the OTel manager config code directly, so I added a unit test that makes sure the expected processor config is there and then separately an integration test that makes sure that including a processor with that config template produces the expected event fields.

@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 17, 2026

Copy link
Member

@mauri870 mauri870 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a test!

@faec faec merged commit 27d1218 into elastic:main Feb 18, 2026
23 checks passed
@faec faec deleted the processors-for-otel-monitoring branch February 18, 2026 13:01
@faec faec added the backport-9.3 Automated backport to the 9.3 branch label Feb 18, 2026
mergify bot pushed a commit that referenced this pull request Feb 18, 2026
Include the `beat` processor in the OTel Collector and use it to apply default processors (most notably `add_host_metadata`) to monitoring events generated by collector internal telemetry. See #12577

(cherry picked from commit 27d1218)

# Conflicts:
#	internal/pkg/otel/translate/otelconfig.go
faec added a commit that referenced this pull request Feb 18, 2026
…onitoring receiver (#12832)

* Apply default processors to events from the monitoring receiver (#12717)

Include the `beat` processor in the OTel Collector and use it to apply default processors (most notably `add_host_metadata`) to monitoring events generated by collector internal telemetry. See #12577

(cherry picked from commit 27d1218)

# Conflicts:
#	internal/pkg/otel/translate/otelconfig.go

* fix merge

---------

Co-authored-by: Fae Charlton <fae.charlton@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.3 Automated backport to the 9.3 branch bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

6 participants