Class BigtableClientMetrics

java.lang.Object
io.github.flink.gcp.connector.bigtable.BigtableClientMetrics

@Internal public final class BigtableClientMetrics extends Object
The Bigtable client's own metrics, registered as rpcMethod.METHOD.leaf on a component's metric group through an ClientMetrics.

The instruments are the public block google-cloud-bigtable records into an injected OpenTelemetry (2.85.0, MetricRegistry.newUserRecorderRegistry). The client records its other instruments, the per-connection and channel-pool ones, only into its built-in Cloud Monitoring exporter. A histogram maps to its count and its millisecond sum, except for the two the client records at most once per operation, which keep only their sums: application latency, recorded for every operation, so its count would repeat operations, and first-response latency, recorded only for a streamed ReadRows and for operations served on the session path (BuiltinMetricsTracer and VRpcTracerImpl).

throttling_latencies is not mapped. In 2.85.0 the client adds a batch's flow-control wait to that total in milliseconds and then records the total as nanoseconds, and it never resets the total between attempts (BuiltinMetricsTracer), so the value is neither a duration in its unit nor per attempt. Map it once a client release records it correctly.

This file is a [[subgroups]] source of scripts/config/metric-docs.toml: the group and every leaf below are read from it, so each leaf owes a row on the connector's page.

  • Method Summary

    Modifier and Type
    Method
    Description
    register(org.apache.flink.metrics.MetricGroup owner, String... methods)
    Creates the client metrics and registers every series of the given methods on the owner's group.
    registerForEnumerators(org.apache.flink.metrics.groups.SplitEnumeratorMetricGroup group, String... methods)
    Returns the client metrics of a source's enumerators: created on the enumerator metric group the first time and handed to every later enumerator built on the same group, with the series of each given method registered once.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • register

      public static ClientMetrics register(org.apache.flink.metrics.MetricGroup owner, String... methods)
      Creates the client metrics and registers every series of the given methods on the owner's group. Call it when the component opens, before any reporter reads the group.
      Parameters:
      owner - the component's metric group
      methods - the RPC methods the component's client calls, without the Bigtable. prefix, such as MutateRows
      Returns:
      the client metrics, whose ClientMetrics.openTelemetry() goes to the client; closing them, after the client, only freezes the counters, which a component whose metric group ends with it need not do
    • registerForEnumerators

      @Nullable public static ClientMetrics registerForEnumerators(@Nullable org.apache.flink.metrics.groups.SplitEnumeratorMetricGroup group, String... methods)
      Returns the client metrics of a source's enumerators: created on the enumerator metric group the first time and handed to every later enumerator built on the same group, with the series of each given method registered once.

      A coordinator reset builds the next enumerator on the group the first one registered on, where a second registration of a name would be dropped and the series would freeze; see EnumeratorMetrics. Shared, they keep counting across resets. Each method is registered on its own, so the sub-sources of a HybridSource, which share one group, each get the series of the methods they call. The client metrics are never closed: a client an enumerator is still closing may record into them, which is no error.

      Parameters:
      group - the enumerator's metric group, or null where the context offers none
      methods - the RPC methods the enumerators' clients call, without the Bigtable. prefix
      Returns:
      the shared client metrics, or null where there is no group