Skip to content

[java-bigtable] throttling_latencies adds flow-control time in milliseconds to a total recorded as nanoseconds, and carries it across attempts #14771

Open

Description

@laughingman7743

Issue Details

throttling_latencies (TableClientBlockingLatency) under-reports the time a bulk mutation spends throttled by the batcher's flow control, by a factor of a million. It also over-reports after a retry, because the total is carried across attempts.

In BuiltinMetricsTracer:

So a batch throttled for 500 ms contributes 500 to a total read as nanoseconds, and throttling_latencies records 0.0005 ms for it. For the bulk MutateRows path, where flow control is the main source of client blocking, the metric is close to zero whatever the throttling.

totalClientBlockingTime is a field of the tracer and is never reset between attempts. Attempt k therefore records the running total of attempts 1 to k, rather than its own blocking time, although the metric is recorded once per attempt.

The likely fix is to keep the total in nanoseconds (addAndGet(throttledTimeNanos) in batchRequestThrottled), and to reset it, or record a per-attempt delta, at each attempt's completion.

Found while exporting the client's metrics into Apache Flink's metric system through CustomOpenTelemetryMetricsProvider (flink-gcp/flink-connector-gcp). This is reported from reading the source; it has not been measured against the service.

Environment

  • Java Version and JDK Vendor: Eclipse Temurin 17

Dependencies

  • Libraries-Bom: 26.90.0
    • google-cloud-bigtable 2.85.0

The affected code is identical in 2.85.0 and on main at 165f02e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions