Skip to content

MetricCollectors

MetricCollectors allows aggregating metrics across registered MetricCollectors.

Creating Instance

MetricCollectors takes the following to be created:

MetricCollectors is created when:

Metrics

MetricCollectors can be given a Metrics (Apache Kafka) when created.

This Metrics is configured to use JmxReporter with io.confluent.ksql.metrics JMX namespace.

Metrics is used to register new metric reporters in addConfigurableReporter.

getMetrics

Metrics getMetrics()

getMetrics returns the Metrics.


getMetrics is used when:

MetricCollectors by ID

Map<String, MetricCollector> collectorMap

MetricCollectors creates an empty collectorMap registry of MetricCollectors by id when created.

A new MetricCollector is added to the collectorMap registry in addCollector and removed in remove.

The MetricCollectors themselves in collectorMap are used when:

Registering MetricCollector

String addCollector(
  String id,
  MetricCollector collector)

addCollector...FIXME


addCollector is used when:

addConfigurableReporter

void addConfigurableReporter(
  KsqlConfig ksqlConfig)

addConfigurableReporter...FIXME


addConfigurableReporter is used when:

aggregateStat

double aggregateStat(
  String name,
  boolean isError)

aggregateStat sums up aggregateStats of all the registered MetricCollectors.


aggregateStat is used when:

currentConsumptionRateByQuery

Collection<Double> currentConsumptionRateByQuery()

currentConsumptionRateByQuery...FIXME


currentConsumptionRateByQuery is used when:

currentErrorRate

double currentErrorRate()

currentErrorRate...FIXME


currentErrorRate is used when:

getStatsFor

Collection<TopicSensors.Stat> getStatsFor(
  String topic,
  boolean isError)

getStatsFor...FIXME


getStatsFor is used when:

  • MetricCollectors is requested to getAndFormatStatsFor
  • SourceDescriptionFactory is requested for a SourceDescription