class StreamsErrorCollector implements MetricCollector {

  public static void recordError(final String applicationId, final String topic) {
    final StreamsErrorCollector errorCollector = COLLECTORS.computeIfAbsent(
        applicationId,
        aid -> {
          final StreamsErrorCollector ec = new StreamsErrorCollector();
          final String collectorId = MetricCollectors.addCollector(aid, ec);
          ec.setId(collectorId);
          return ec;
        }
    );
    errorCollector.collect(topic);
  }

  private  StreamsErrorCollector();

}