Expand description
Client metrics push (KIP-714).
When Kafka’s enable.metrics.push is on (the default), a producer,
consumer or admin client asks a broker for its client metrics
subscription with GetTelemetrySubscriptions, and pushes the metrics that
the subscription names with PushTelemetry at the push interval. On close
it sends one last push with terminating set.
ClientTelemetry is that reporter, as Kafka’s ClientTelemetryReporter
and the telemetry sender of its NetworkClient are. A Client built
with ClientTelemetryConfig starts one. The metrics come from a
ClientMetrics registry; client-core registers the network metrics of
Kafka’s Selector in it.
Differences from Kafka:
- The reporter sends on a connection that the client already has open. It does not open a connection of its own, so a client that has no open connection pushes nothing until it opens one.
- A subscription with the zero client instance id stops telemetry. Kafka’s reporter throws from its response handler, after which it sends no further request.
Modules§
- otlp
- The part of the OpenTelemetry metrics protocol (OTLP) that a KIP-714 client pushes.
Structs§
- Client
Metrics - The metric registry of one client. A clone shares the registry.
- Client
Telemetry - A running KIP-714 reporter. Dropping it starts the close, as
closedoes, without the wait. - Client
Telemetry Config - What a client pushes: its type and the resource attributes of every
metric (
ClientTelemetryProvider.contextChange). - Counter
- A monotonic counter, pushed as an OTLP sum (Kafka’s
CumulativeSumandWindowedCount). - Gauge
- A value that goes up and down, pushed as an OTLP gauge.
- Metric
Key - The name and attributes of one metric, as KIP-714 names them.
- Network
Metrics - The network metrics of a client’s connections: the
-totalmetrics of Kafka’sSelectorin the client’s metric group, and itsconnection-count. - Telemetry
Timing - The timing of a reporter.
Enums§
- Telemetry
Client Type - The kind of client, which names its metric group.
Constants§
- TELEMETRY_
METRIC_ DOMAIN - The prefix of every client metric name
(
ClientTelemetryProvider.DOMAIN).
Traits§
- Telemetry
Connections - The connections that a reporter sends on.
Functions§
- client_
instance_ id - Kafka’s
clientInstanceIdof a producer, consumer or admin client (ClientTelemetryUtils.fetchClientInstanceId).