Skip to content

Remove experimental loadable Go plugin support#51320

Open
orestisfl wants to merge 5 commits into
elastic:mainfrom
orestisfl:remove-go-plugins
Open

Remove experimental loadable Go plugin support#51320
orestisfl wants to merge 5 commits into
elastic:mainfrom
orestisfl:remove-go-plugins

Conversation

@orestisfl

Copy link
Copy Markdown
Contributor

Proposed commit message

Remove experimental loadable Go plugin support

The loadable Go plugin support was experimental: it was opt-in via the
`--plugin` flag, which loaded Go plugin bundles at startup and logged an
"experimental" warning when used. It was never promoted to a stable feature and
no plugins were ever shipped.

This removes the libbeat/plugin package, the `--plugin` flag, and the related
plugin registration helpers (Plugin, RegisterLoader, MustRegisterLoader) across
libbeat, filebeat, heartbeat, metricbeat and packetbeat, along with the global
plugin registry, which was a package-level global variable.

Co-authored-by: Lee E. Hinman <lee.e.hinman@elastic.co>

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 (couldn't find anything)
  • 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. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

The plugin support was experimental and no plugins were ever shipped, so no stable functionality is affected. The --plugin flag is no longer recognized and anyone who compiled their own Go plugins against these experimental APIs will no longer be able to load them.

How to test this PR locally

Confirm the --plugin flag is gone, e.g. filebeat --help no longer lists it.

Related issues

The loadable Go plugin support was experimental: it was opt-in via the
`--plugin` flag, which loaded Go plugin bundles at startup and logged an
"experimental" warning when used. It was never promoted to a stable feature and
no plugins were ever shipped.

This removes the libbeat/plugin package, the `--plugin` flag, and the related
plugin registration helpers (Plugin, RegisterLoader, MustRegisterLoader) across
libbeat, filebeat, heartbeat, metricbeat and packetbeat, along with the global
plugin registry, which was a package-level global variable.

Relates: elastic#44903

Co-authored-by: Lee E. Hinman <lee.e.hinman@elastic.co>
@orestisfl orestisfl added Team:obs-ds-hosted-services Label for the Observability Hosted Services team breaking change backport-skip Skip notification from the automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Jun 17, 2026
@orestisfl orestisfl self-assigned this Jun 17, 2026
@botelastic botelastic Bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 392dd155-6098-4eb4-9dd1-5f27154652af

📥 Commits

Reviewing files that changed from the base of the PR and between 4b15a31 and 6d4b80c.

📒 Files selected for processing (23)
  • changelog/fragments/1781686561-remove-libbeat-plugin.yaml
  • filebeat/include/list.go
  • filebeat/input/plugin.go
  • heartbeat/include/list.go
  • heartbeat/monitors/plugin/plugin.go
  • libbeat/autodiscover/appenders/registry.go
  • libbeat/autodiscover/builder/plugin.go
  • libbeat/autodiscover/providers/plugin.go
  • libbeat/cmd/instance/beat.go
  • libbeat/cmd/root.go
  • libbeat/outputs/codec/plugin.go
  • libbeat/outputs/plugin.go
  • libbeat/plugin/cli.go
  • libbeat/plugin/cli_stub.go
  • libbeat/plugin/load.go
  • libbeat/plugin/load_stub.go
  • libbeat/plugin/plugin.go
  • libbeat/processors/add_kubernetes_metadata/registry.go
  • libbeat/processors/registry.go
  • metricbeat/module/plugin.go
  • packetbeat/protocols/plugin.go
  • x-pack/libbeat/cmd/instance/beat.go
  • x-pack/libbeat/processors/add_nomad_metadata/registry.go
💤 Files with no reviewable changes (21)
  • libbeat/plugin/cli.go
  • libbeat/outputs/plugin.go
  • libbeat/autodiscover/providers/plugin.go
  • libbeat/outputs/codec/plugin.go
  • libbeat/autodiscover/builder/plugin.go
  • libbeat/plugin/load.go
  • x-pack/libbeat/processors/add_nomad_metadata/registry.go
  • packetbeat/protocols/plugin.go
  • filebeat/input/plugin.go
  • libbeat/autodiscover/appenders/registry.go
  • libbeat/plugin/load_stub.go
  • libbeat/processors/add_kubernetes_metadata/registry.go
  • libbeat/plugin/plugin.go
  • heartbeat/include/list.go
  • filebeat/include/list.go
  • metricbeat/module/plugin.go
  • x-pack/libbeat/cmd/instance/beat.go
  • libbeat/plugin/cli_stub.go
  • libbeat/cmd/instance/beat.go
  • libbeat/processors/registry.go
  • libbeat/cmd/root.go

📝 Walkthrough

Walkthrough

The PR removes the experimental Go plugin system from libbeat and all dependent beats. The entire libbeat/plugin package is deleted, along with every per-subsystem Plugin() helper function and init() loader registration in filebeat, heartbeat, metricbeat, packetbeat, outputs, autodiscover, and processor packages. The --plugin CLI flag and the plugin.Initialize() call in (*Beat).InitWithSettings (both OSS and x-pack variants) are removed. Generated include/list.go files drop the now-unnecessary blank imports, and a breaking-change changelog fragment is added.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed PR comprehensively removes Go plugin support across all beat components, eliminating the global plugin registry and --plugin flag as required by #45840.
Out of Scope Changes check ✅ Passed All changes are directly aligned with plugin removal objectives; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@orestisfl orestisfl added the Team:Security-Linux Platform Linux Platform Team in Security Solution label Jun 17, 2026
@orestisfl orestisfl marked this pull request as ready for review June 17, 2026 11:37
@orestisfl orestisfl requested review from a team as code owners June 17, 2026 11:37
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform)

@github-actions

This comment has been minimized.

@blakerouse blakerouse left a comment

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.

Nice!

@cmacknz

cmacknz commented Jun 17, 2026

Copy link
Copy Markdown
Member

Building x-pack/filebeat on MacOS, it looks like just this PR shrinks it from 178M to 158M when compared to main.

@mauri870

Copy link
Copy Markdown
Member

Building x-pack/filebeat on MacOS, it looks like just this PR shrinks it from 178M to 158M when compared to main.

On linux it goes from 246M to 195M for me.

@rdner rdner left a comment

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.

The change looks good to me.

The packaging step on ARM is failing, I tried to restart but looks like the failure is legit.

Also the linter issues need to be resolved.

@orestisfl

Copy link
Copy Markdown
Contributor Author

The change looks good to me.

The packaging step on ARM is failing, I tried to restart but looks like the failure is legit.

Yes this is blocked until quark backports elastic/go-quark@12841a4 in 0.3.0 that beats is using or we upgrade to

CC @haesbaert

@haesbaert

Copy link
Copy Markdown
Contributor

The change looks good to me.
The packaging step on ARM is failing, I tried to restart but looks like the failure is legit.

Yes this is blocked until quark backports elastic/go-quark@12841a4 in 0.3.0 that beats is using or we upgrade to

CC @haesbaert

Heya, I think the linker likely changed, since that symbol never really existed in arm64, that's pretty much the issue the wolfi people stumbled and hence we did the fix.

I'll update quark, the API changed a bit so more things are likely needed, but it's time to do it anyway.

@leehinman leehinman left a comment

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.

Thanks for picking this up. LGTM.

@orestisfl

Copy link
Copy Markdown
Contributor Author

Putting in draft mode as it's blocked on #51320 (comment)

@orestisfl orestisfl marked this pull request as draft June 25, 2026 06:54
@haesbaert haesbaert mentioned this pull request Jul 7, 2026
6 tasks
@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

The Filebeat: Log input as Filestream Python Integration Tests job did not reach the tests. Docker image construction failed twice while downloading Kafka 3.6.0 from Apache with curl exit code 28 (timeout), so this is an infrastructure/dependency availability failure rather than a regression from the plugin-removal changes.

Remediation

  • Re-run the failed Buildkite job; the existing Kafka image step already retries the download (retry --min 1 --max 180).
  • If the timeout persists, investigate access/availability of the Apache archive endpoint or use a healthy mirror/cache for the Kafka archive, then rerun mage PythonIntegTestLogAsFilestream.
Investigation details

Root Cause

The failure occurs during docker compose ... build, before any Python integration test starts. The Kafka image build downloads kafka_2.13-3.6.0.tgz from archive.apache.org; the command exits with status 28 on both build attempts, and Mage then reports exit status 17. The PR changes remove Go plugin support and do not modify testing/environments/docker/kafka/Dockerfile or the Kafka test setup.

Evidence

  • Build: https://buildkite.com/elastic/beats/builds/49180
  • Job/step: :ubuntu: Filebeat: Log input as Filestream Python Integration Tests (https://buildkite.com/elastic/filebeat/builds/34333)
  • Key log excerpt: failed to solve: process ... curl ... https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.13-${KAFKA_VERSION}.tgz ... did not complete successfully: exit code: 28 (lines 127 and 131); docker compose ... build failed with exit code 17 (line 133).
  • Source: testing/environments/docker/kafka/Dockerfile:15-19 downloads Kafka 3.6.0 and wraps the download with the retry helper.

Verification

  • Not run locally: the failure is in the Buildkite Docker image build, and reproducing the full integration environment is unavailable here.

What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@orestisfl orestisfl marked this pull request as ready for review July 10, 2026 11:38
@orestisfl orestisfl requested a review from haesbaert July 10, 2026 11:38
@mergify

mergify Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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 remove-go-plugins upstream/remove-go-plugins
git merge upstream/main
git push upstream remove-go-plugins

# Conflicts:
#	filebeat/input/plugin.go
#	libbeat/autodiscover/appenders/registry.go
#	libbeat/autodiscover/builder/plugin.go
#	libbeat/autodiscover/providers/plugin.go
#	libbeat/outputs/codec/plugin.go
#	libbeat/outputs/plugin.go
#	libbeat/plugin/load.go
#	libbeat/plugin/plugin.go
#	libbeat/processors/add_kubernetes_metadata/registry.go
#	libbeat/processors/registry.go
#	metricbeat/module/plugin.go
#	x-pack/libbeat/processors/add_nomad_metadata/registry.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip Skip notification from the automated backport with mergify breaking change Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:obs-ds-hosted-services Label for the Observability Hosted Services team Team:Security-Linux Platform Linux Platform Team in Security Solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants