Skip to content

[9.1](backport #45145) [beatreceivers] Introduce otel mode for metricbeat#45312

Merged
khushijain21 merged 2 commits into9.1from
mergify/bp/9.1/pr-45145
Jul 11, 2025
Merged

[9.1](backport #45145) [beatreceivers] Introduce otel mode for metricbeat#45312
khushijain21 merged 2 commits into9.1from
mergify/bp/9.1/pr-45145

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Jul 10, 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

This is an automatic backport of pull request #45145 done by [Mergify](https://mergify.com).

* [beatreceivers] Introduce otel mode for metricbeat

(cherry picked from commit f0b0f2a)

# Conflicts:
#	x-pack/libbeat/common/otelbeat/otel.go
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Jul 10, 2025
@mergify mergify Bot requested a review from a team as a code owner July 10, 2025 18:12
@mergify mergify Bot added the backport label Jul 10, 2025
@mergify mergify Bot removed the request for review from a team July 10, 2025 18:12
@mergify mergify Bot added the conflicts There is a conflict in the backported pull request label Jul 10, 2025
@mergify mergify Bot requested a review from faec July 10, 2025 18:12
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Jul 10, 2025

Cherry-pick of f0b0f2a has failed:

On branch mergify/bp/9.1/pr-45145
Your branch is up to date with 'origin/9.1'.

You are currently cherry-picking commit f0b0f2a91.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   dev-tools/mage/build.go
	modified:   libbeat/otelbeat/beatconverter/beatconverter.go
	modified:   libbeat/otelbeat/providers/fbprovider/fbprovider.go
	modified:   libbeat/otelbeat/providers/fbprovider/fbprovider_test.go
	new file:   libbeat/otelbeat/providers/mbprovider/mbprovider.go
	new file:   libbeat/otelbeat/providers/mbprovider/mbprovider_test.go
	new file:   libbeat/otelbeat/providers/providers.go
	modified:   libbeat/tests/integration/framework.go
	modified:   x-pack/filebeat/cmd/otelcmd_enabled.go
	modified:   x-pack/filebeat/magefile.go
	new file:   x-pack/metricbeat/cmd/otelcmd_disabled.go
	new file:   x-pack/metricbeat/cmd/otelcmd_enabled.go
	modified:   x-pack/metricbeat/cmd/root.go
	modified:   x-pack/metricbeat/docker-compose.yml
	modified:   x-pack/metricbeat/magefile.go
	new file:   x-pack/metricbeat/metricbeat-otel.yml
	new file:   x-pack/metricbeat/tests/integration/otel_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   x-pack/libbeat/common/otelbeat/otel.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify Bot requested a review from khushijain21 July 10, 2025 18:12
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 10, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🤖 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!)

@github-actions github-actions Bot added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jul 10, 2025
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 10, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@pierrehilbert
Copy link
Copy Markdown
Contributor

@khushijain21 could you please fix the conflicts?

@khushijain21 khushijain21 enabled auto-merge (squash) July 11, 2025 08:21
@khushijain21 khushijain21 merged commit 2b2f807 into 9.1 Jul 11, 2025
202 of 205 checks passed
@khushijain21 khushijain21 deleted the mergify/bp/9.1/pr-45145 branch July 11, 2025 09:42
defer metricbeat.Stop()

// prepare to query ES
es := integration.GetESClient(t, "http")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@khushijain21 I'm not sure how this managed to pass CI checks, this function is not present on 9.1 :/

Copy link
Copy Markdown
Contributor

@khushijain21 khushijain21 Jul 11, 2025

Choose a reason for hiding this comment

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

that is very strange because the build did fail the stage did not

link

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh now I know - the mage command does not check if the main integ test failed or not. I will update the code. Thanks @mauri870

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

Labels

backport conflicts There is a conflict in the backported pull request 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.

4 participants