liveBook · Manning

Client metric

As explained in Apache Kafka in Action

A client metric is an operational measurement describing the behavior, health, resource use, or traffic of a Kafka client.

A client metric measures the behavior, health, resource use, or traffic of a Kafka client. It helps reveal when producers, consumers, Kafka Connect, or Kafka Streams applications fall behind, exhaust memory, crash, or otherwise threaten data reliability. section 15.3.1

Client metrics are organized by client domain: producer, consumer, connect, or stream. A client ID label associates each measurement with its client; Prometheus exposes the metrics without the client-type prefix. Connection counts and authentication outcomes provide additional signals that are not specific to one client type. section 15.3.1

Use client metrics to investigate operational symptoms such as:

  • Frequent changes in consumer connections, which can indicate repeated consumer-group rebalancing; consumption pauses during rebalancing and application data becomes outdated. section 15.3.1
  • Failed authentications, which may indicate authentication-system problems in addition to incorrect credentials and should be investigated promptly. section 15.3.1
  • Resource pressure or processing delay, where CPU, memory, or network limitations can slow clients, cause out-of-memory errors, or produce crashes. section 15.3.1

Diagnosing changing consumer connections

A consumer group whose connection count repeatedly rises and falls warrants investigation for frequent rebalancing. Because no data is consumed during a rebalance, the dependent application may process increasingly outdated data. Check consumer health and related client metrics rather than treating the connection change as an isolated network fluctuation. section 15.3.1

Client metrics complement broker monitoring: a healthy Kafka cluster still depends on clients to produce and consume data reliably. Producer errors and request latency, consumer lag and rebalances, connector health, and Streams processing duration expose problems at different points in the data path. section 15.6

How Apache Kafka in Action covers it

How deep it goes
Defines client-metric domains and operational signals, then stops short of specifying metric queries, thresholds, or alert configurations.
Examples
Uses client IDs, connection counts, authentication failures, producer errors, request latency, consumer lag, rebalances, and processing duration.
What you can do after
Diagnose client-side delays, failures, rebalances, authentication problems, and consumption slowdowns using Kafka-specific measurements.
How it connects
Connects Kafka producers, consumers, Kafka Connect, Kafka Streams, consumer groups, rebalancing, Prometheus, authentication, and consumer lag.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.