Skip to content


StreamsErrorCollector is a MetricCollector to record consumer failed messages metrics (per source topic).

The metrics are registered in consumer-metrics group.

consumer-metrics in jconsole

Creating Instance

StreamsErrorCollector takes the following to be created:

StreamsErrorCollector is created using create.

Creating StreamsErrorCollector

StreamsErrorCollector create(
  String applicationId,
  MetricCollectors collectors)

create creates a StreamsErrorCollector with the given MetricCollectors.

create requests the MetricCollectors to register the StreamsErrorCollector for the applicationId.

create is used when:

Topic Sensors

Map<String, TopicSensors<Object>> topicSensors

StreamsErrorCollector builds sensors per topic when recordError.



Recording Error

void recordError(
  String topic)

recordError looks up the given topic in the topic sensors (or creates a new one) and increments the sensor.

recordError is used when:


TopicSensors<Object> buildSensors(
  String topic)

buildSensors builds the sensors for the topic.