Skip to content

StreamsErrorCollector

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.

consumer-failed-messages

consumer-failed-messages-per-sec

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:

buildSensors

TopicSensors<Object> buildSensors(
  String topic)

buildSensors builds the sensors for the topic.