Skip to content

Commit 445a667

Browse files
fix: only record retry count when it's > 0 (#1488)
* fix: only record retry count when it's > 0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent e67ac61 commit 445a667

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ private void recordOperationCompletion(@Nullable Throwable status) {
232232
operationTimer.stop();
233233
long operationLatency = operationTimer.elapsed(TimeUnit.MILLISECONDS);
234234

235-
recorder.putRetryCount(attemptCount - 1);
235+
// Only record when retry count is greater than 0 so the retry
236+
// graph will be less confusing
237+
if (attemptCount > 1) {
238+
recorder.putRetryCount(attemptCount - 1);
239+
}
236240

237241
// serverLatencyTimer should already be stopped in recordAttemptCompletion
238242
recorder.putOperationLatencies(operationLatency);

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public class BuiltinMetricsIT {
4848

4949
public static String[] VIEWS = {
5050
"operation_latencies",
51-
"retry_count",
5251
"attempt_latencies",
5352
"connectivity_error_count",
5453
"application_blocking_latencies"

0 commit comments

Comments
 (0)