Class SpannerClientMetrics
rpcMethod.METHOD.leaf on a component's
metric group through a ClientMetrics.
The instruments are what google-cloud-spanner records into the OpenTelemetry
of a CustomOpenTelemetryMetricsProvider (6.124.0, BuiltInMetricsRecorder and its
gax parent OpenTelemetryMetricsRecorder), all named under spanner/client/: the
operation and attempt counts and latencies gax records for every data-client RPC, and the Google
front end (GFE) and Spanner API front end (AFE) latencies and missing-header counts Spanner adds
per attempt. The client's gRPC-layer metrics need an OpenTelemetry SDK instance and are not
recorded here. The operation and attempt counts come from the client's counters; the latency
histograms, which the client records at the same points, keep only their sums.
The client records nothing into a provider when it runs in its emulator mode, which is how the
connector reaches an emulator (SpannerClients).
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe RPC the sink writes through.static final StringThe RPC that opens a batch read's snapshot.static final StringThe RPC every client's database handle sends once, for its multiplexed session.static final StringThe RPC of every query: the dialect, schema reads, Change Streams queries, partitions.static final StringThe RPC that partitions a query.static final StringThe RPC that partitions a table read.static final StringThe RPC of a point or table read, including a partition of one. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientMetricsCreates the client metrics and registers every series of the given methods on the owner's group.static ClientMetricsregisterForEnumerators(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.
-
Field Details
-
CREATE_SESSION
The RPC every client's database handle sends once, for its multiplexed session.- See Also:
-
EXECUTE_STREAMING_SQL
The RPC of every query: the dialect, schema reads, Change Streams queries, partitions.- See Also:
-
STREAMING_READ
The RPC of a point or table read, including a partition of one.- See Also:
-
BATCH_WRITE
The RPC the sink writes through.- See Also:
-
BEGIN_TRANSACTION
The RPC that opens a batch read's snapshot.- See Also:
-
PARTITION_QUERY
The RPC that partitions a query.- See Also:
-
PARTITION_READ
The RPC that partitions a table read.- See Also:
-
-
Method Details
-
register
Creates the client metrics and registers every series of the given methods on the owner's group. Call it when the component opens, before its client is built and before any reporter reads the group.- Parameters:
owner- the component's metric groupmethods- the RPC methods the component's client calls, without theSpanner.prefix, such asBATCH_WRITE- Returns:
- the client metrics, whose
ClientMetrics.openTelemetry()goes to the client and which the client's owner closes after the client
-
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 aHybridSource, 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, ornullwhere the context offers nonemethods- the RPC methods the enumerators' clients call, without theSpanner.prefix- Returns:
- the shared client metrics, or
nullwhere there is no group
-