Skip to content

Add UpdateStatus reporter to packetbeat runners#45732

Merged
fearful-symmetry merged 39 commits intoelastic:mainfrom
fearful-symmetry:packetbeat-status-reporter
Oct 7, 2025
Merged

Add UpdateStatus reporter to packetbeat runners#45732
fearful-symmetry merged 39 commits intoelastic:mainfrom
fearful-symmetry:packetbeat-status-reporter

Conversation

@fearful-symmetry
Copy link
Contributor

Proposed commit message

Closes #44655

This adds a StatusReporter to the packetbeat runner interface. Two things to note here:

  1. I wasn't a fan of how we called Create() and SetStatusReporter() as two separate steps, as it means we don't get a StatusReporter object until after the initialization is complete. I added a CreateWithReporter interface to get around this, so we can set Configuring state at the proper time. If there's a reason why we don't want this, please tell me.
  2. This is a very simple PR, as packetbeat doesn't have modules/metricsets like other beats, so we're just setting statuses on Configure and Start/Error/Stop for the overall packetbeat runner.

Tested in elastic-cloud 9.2.0.

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.
@fearful-symmetry fearful-symmetry self-assigned this Aug 4, 2025
@fearful-symmetry fearful-symmetry requested review from a team as code owners August 4, 2025 20:33
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 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
Contributor

mergify bot commented Aug 4, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @fearful-symmetry? 🙏.
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.
@pierrehilbert pierrehilbert added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Security-Linux Platform Linux Platform Team in Security Solution labels Aug 5, 2025
@elasticmachine
Copy link
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 Aug 5, 2025
@elasticmachine
Copy link
Contributor

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

@pierrehilbert pierrehilbert requested review from faec and removed request for andrzej-stencel August 5, 2025 08:46
Copy link
Contributor

@faec faec left a comment

Choose a reason for hiding this comment

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

One cleanup suggestion, but looks good

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

nil; the type does not need to be exported.

@fearful-symmetry fearful-symmetry merged commit 42b613a into elastic:main Oct 7, 2025
211 checks passed
andrzej-stencel pushed a commit to andrzej-stencel/beats that referenced this pull request Dec 1, 2025
* add status reporter to packetbeat processor

* add state reporters to sniffer

* fix test for status updates

* linter...

* still tinkering with the linter

* fix int check issue, cleanup

* linter...

* feedback

* oops

* imports

* use noop reporter

* Update libbeat/management/status/status.go

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>

* fix status

* change noop status

* add fragment

---------

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Security-Linux Platform Linux Platform Team in Security Solution

7 participants