Skip to content

Commit

Permalink
Avoid NaN in Commit Offset Failure Rate OffsetCommitServiceMetrics by… (
Browse files Browse the repository at this point in the history
#292)

* Avoid NaN in Commit Offset Failure Rate OffsetCommitServiceMetrics by initializing with a zero only when instantiating.
Signed-off-by: Andrew Choi <[email protected]>
❄️
  • Loading branch information
Andrew Choi authored Jul 3, 2020
1 parent c85d8bd commit 5e64f50
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public OffsetCommitServiceMetrics(final Metrics metrics, final Map<String, Strin
new Total());

_offsetCommitFailSensor = metrics.sensor(FAILURE_SENSOR_NAME);
/* NaN will persist as long as no record is submitted to the failure sensor.
we'll continue with NaN for now since we'd rather that the Sensor itself is a true and unaltered record of what values it recorded. */
_offsetCommitFailSensor.add(new MetricName(FAILURE_RATE_METRIC, METRIC_GROUP_NAME,
"The failure rate of group coordinator accepting consumer offset commit requests.", tags), new Avg());
_offsetCommitFailSensor.add(new MetricName(FAILURE_METRIC_TOTAL, METRIC_GROUP_NAME,
Expand Down

0 comments on commit 5e64f50

Please sign in to comment.