Skip to content

Fix stats beat failure count metrics reporting incorrect values#47884

Merged
jeanbisutti merged 2 commits intomainfrom
jean/fix-statsbeat-failure-count-metrics
Feb 4, 2026
Merged

Fix stats beat failure count metrics reporting incorrect values#47884
jeanbisutti merged 2 commits intomainfrom
jean/fix-statsbeat-failure-count-metrics

Conversation

@jeanbisutti
Copy link
Contributor

@jeanbisutti jeanbisutti commented Feb 3, 2026

Fix bugs related to stats beat read and write failure count.

@jeanbisutti jeanbisutti requested a review from trask as a code owner February 3, 2026 15:30
Copilot AI review requested due to automatic review settings February 3, 2026 15:30
@github-actions github-actions bot added the Monitor - Autoconfigure Monitor OpenTelemetry Autoconfigure label Feb 3, 2026
@jeanbisutti jeanbisutti changed the title Fix statsbeat failure count metrics reporting incorrect values Fix stats beat failure count metrics reporting incorrect values Feb 3, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes critical bugs in the statsbeat failure count metrics reporting where incorrect values were being sent to telemetry. The bugs were caused by using the wrong variables when creating telemetry items - the code was reading from atomic counters after they had been reset instead of using the captured values, and there was a copy-paste error where readFailureCount was used instead of writeFailureCount.

Changes:

  • Fixed three bugs in NonessentialStatsbeat.send() method that caused incorrect metric values to be reported
  • Added comprehensive test coverage to verify the fixes and prevent regression

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
NonessentialStatsbeat.java Fixed bugs on lines 38, 42, and 45: using captured values instead of re-reading atomic counters, and correcting copy-paste error where readFailureCount was used instead of writeFailureCount
NonessentialStatsbeatTest.java Added three new test methods to verify correct metric values are sent and counters are properly reset after sending

@jeanbisutti jeanbisutti enabled auto-merge (squash) February 4, 2026 08:43
@jeanbisutti jeanbisutti merged commit e5fbecc into main Feb 4, 2026
19 checks passed
@jeanbisutti jeanbisutti deleted the jean/fix-statsbeat-failure-count-metrics branch February 4, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Autoconfigure Monitor OpenTelemetry Autoconfigure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants