Skip to content

metricbeat: remove redundant paths field from module Factory#49840

Open
orestisfl wants to merge 2 commits intoelastic:mainfrom
orestisfl:metricbeat-use-info-paths
Open

metricbeat: remove redundant paths field from module Factory#49840
orestisfl wants to merge 2 commits intoelastic:mainfrom
orestisfl:metricbeat-use-info-paths

Conversation

@orestisfl
Copy link
Copy Markdown
Contributor

@orestisfl orestisfl commented Apr 1, 2026

Proposed commit message

metricbeat: remove redundant paths field from module Factory

The module Factory stored both beatInfo and a separate *paths.Path
field. Now that Info carries Paths, drop the redundant field and
parameter from NewFactory, and use beatInfo.Paths when creating
modules and wrappers.

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/fragments using the changelog tool.

Disruptive User Impact

None. Internal API change only.

How to test this PR locally

Related issues

@orestisfl orestisfl added refactoring Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team backport-active-all Automated backport with mergify to all the active branches skip-changelog labels Apr 1, 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 Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

🤖 GitHub comments

Just comment with:

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

Now that Paths lives in beat.Info, there is no need to store it
as a separate field alongside beatInfo in the Factory struct.
@orestisfl orestisfl force-pushed the metricbeat-use-info-paths branch from ef7ed92 to 16cb1f1 Compare April 17, 2026 10:31
@orestisfl orestisfl marked this pull request as ready for review April 17, 2026 10:36
@orestisfl orestisfl requested a review from a team as a code owner April 17, 2026 10:36
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e6ad7970-d0da-4c44-a243-2852cf90daea

📥 Commits

Reviewing files that changed from the base of the PR and between 184a91b and 16cb1f1.

📒 Files selected for processing (2)
  • metricbeat/beater/metricbeat.go
  • metricbeat/mb/module/factory.go

📝 Walkthrough

Walkthrough

The paths parameter was removed from the NewFactory function signature in metricbeat/mb/module/factory.go. The factory no longer stores paths as a field and instead accesses them through beatInfo.Paths when creating modules and wrappers. Corresponding call sites in metricbeat/beater/metricbeat.go were updated to no longer pass the paths argument when constructing factory instances. The refactoring maintains existing control flow and module instantiation behavior while centralizing path access through the beat info object.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

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

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

Labels

backport-active-all Automated backport with mergify to all the active branches refactoring skip-changelog 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.

[beatreceiver] move paths object into Beat.Info

2 participants