Skip to content

add metrics logging to beat receivers#48541

Merged
leehinman merged 2 commits intoelastic:mainfrom
leehinman:30s_logging_receivers
Jan 28, 2026
Merged

add metrics logging to beat receivers#48541
leehinman merged 2 commits intoelastic:mainfrom
leehinman:30s_logging_receivers

Conversation

@leehinman
Copy link
Contributor

Proposed commit message

Add MakeReporter to beat receivers start up. This will produce the
"Non-zero metrics in the last 30s" in the logs. Also added the Stop
function to the beat receiver shutdown

This is necessary so the metrics will end up in the elastic-agent
diagnostics output.

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. 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

  • This will produce logs that were not being produced before

Author's Checklist

  • [ ]

How to test this PR locally

Integration tests

cd x-pack/filebeat/fbreceiver && go test .
cd x-pack/metricbeat/mbreceiver && go test .

In elastic-agent

  1. Build elastic-agent with this PR
  2. Install elastic-agent with system integration
  3. allow agent to run for at least 30 seconds
  4. jq -r 'select (.message == "Non-zero metrics in the last 30s") | .component.id' *.ndjson | sort -u in logs directory

You should see that every component is producing it's own 30s metrics log entries

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 26, 2026
@github-actions
Copy link
Contributor

🤖 GitHub comments

Just comment with:

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

@leehinman leehinman added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team bugfix backport-9.3 Automated backport to the 9.3 branch labels Jan 26, 2026
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 26, 2026
@mergify
Copy link
Contributor

mergify bot commented Jan 26, 2026

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @leehinman? 🙏.
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.

@leehinman leehinman force-pushed the 30s_logging_receivers branch from 73baabf to 845e0b2 Compare January 26, 2026 19:29
@leehinman leehinman marked this pull request as ready for review January 26, 2026 19:36
@leehinman leehinman requested a review from a team as a code owner January 26, 2026 19:36
@leehinman leehinman requested review from mauri870 and rdner January 26, 2026 19:36
@elasticmachine
Copy link
Contributor

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

Copy link
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, nothing stands out aside from the already existing comments.

@leehinman leehinman merged commit 21b7dfc into elastic:main Jan 28, 2026
207 of 210 checks passed
mergify bot pushed a commit that referenced this pull request Jan 28, 2026
* add metrics logging to beat receivers

(cherry picked from commit 21b7dfc)
leehinman added a commit that referenced this pull request Jan 28, 2026
* add metrics logging to beat receivers

(cherry picked from commit 21b7dfc)

Co-authored-by: Lee E Hinman <57081003+leehinman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.3 Automated backport to the 9.3 branch bugfix 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