Skip to content

[beatreceivers] Introduce otel mode for metricbeat#45145

Merged
khushijain21 merged 20 commits intoelastic:mainfrom
khushijain21:mbreceiver
Jul 10, 2025
Merged

[beatreceivers] Introduce otel mode for metricbeat#45145
khushijain21 merged 20 commits intoelastic:mainfrom
khushijain21:mbreceiver

Conversation

@khushijain21
Copy link
Copy Markdown
Contributor

@khushijain21 khushijain21 commented Jul 2, 2025

Proposed commit message

This PR introduces otel mode for metricbeat. This will allow us to write e2e test for metricbeat inputs.

Checklist

  • 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.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

cd x-pack/metricbeat
mage buildOTel
./metricbeat otel --config metricbeat-otel.yml

Tests:

cd x-pack/metricbeat
go test -c -tags otelbeat
go test   -tags "integration" -run 'TestMetricbeatOTel.*' ./tests/integration -v -count=1

@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 2, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 2, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jul 2, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @khushijain21? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport 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.

@khushijain21 khushijain21 marked this pull request as ready for review July 2, 2025 08:14
@khushijain21 khushijain21 requested a review from a team as a code owner July 2, 2025 08:14
@khushijain21 khushijain21 added backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Jul 2, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 2, 2025
Comment thread libbeat/otelbeat/providers/common_provider.go
Copy link
Copy Markdown
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.

Looks good! Can you add an integration test to otel_test.go now that we have that available?

Copy link
Copy Markdown
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.

We should probably have a otel_test.go following the same approach as fbreceiver.

Comment thread libbeat/otelbeat/providers/common_provider.go
Comment thread libbeat/otelbeat/providers/common_provider.go
Comment thread libbeat/otelbeat/providers/mbprovider/mbprovider.go Outdated
Comment thread libbeat/otelbeat/providers/mbprovider/mbprovider.go
Comment thread libbeat/otelbeat/providers/mbprovider/mbprovider.go Outdated
Comment thread x-pack/libbeat/common/otelbeat/otel.go Outdated
Comment thread x-pack/libbeat/common/otelbeat/otel.go Outdated
Comment thread libbeat/otelbeat/providers/mbprovider/mbprovider_test.go Outdated
Comment thread libbeat/otelbeat/providers/mbprovider/mbprovider_test.go Outdated
@khushijain21 khushijain21 requested a review from mauri870 July 9, 2025 06:41
Comment thread x-pack/metricbeat/magefile.go Outdated
Comment thread x-pack/metricbeat/magefile.go Outdated
@khushijain21 khushijain21 marked this pull request as ready for review July 10, 2025 04:37
Copy link
Copy Markdown
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.

LGTM, thanks! Please address the remaining open comments before merging.

@khushijain21 khushijain21 enabled auto-merge (squash) July 10, 2025 16:23
@khushijain21 khushijain21 merged commit f0b0f2a into elastic:main Jul 10, 2025
202 of 205 checks passed
mergify Bot pushed a commit that referenced this pull request Jul 10, 2025
* [beatreceivers] Introduce otel mode for metricbeat

(cherry picked from commit f0b0f2a)
mergify Bot pushed a commit that referenced this pull request Jul 10, 2025
* [beatreceivers] Introduce otel mode for metricbeat

(cherry picked from commit f0b0f2a)

# Conflicts:
#	x-pack/libbeat/common/otelbeat/otel.go
khushijain21 added a commit that referenced this pull request Jul 11, 2025
* [beatreceivers] Introduce otel mode for metricbeat

(cherry picked from commit f0b0f2a)

Co-authored-by: Khushi Jain <khushi.jain@elastic.co>
@khushijain21 khushijain21 added the backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches label Jul 11, 2025
khushijain21 pushed a commit that referenced this pull request Jul 11, 2025
…beat (#45312)

* [beatreceivers] Introduce otel mode for metricbeat (#45145)
@mauri870 mauri870 mentioned this pull request Jul 17, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants