Skip to main content

MetricsReporter

Trait MetricsReporter 

Source
pub trait MetricsReporter: Send + Sync {
    // Provided methods
    fn init(&self, metrics: &[Arc<KafkaMetric>]) { ... }
    fn metric_change(&self, metric: &Arc<KafkaMetric>) { ... }
    fn metric_removal(&self, metric: &Arc<KafkaMetric>) { ... }
    fn close(&self) { ... }
}
Expand description

A plugin interface to allow things to listen as new metrics are created so they can be reported.

Implement ClusterResourceListener to receive cluster metadata once it’s available. Please see the class documentation for ClusterResourceListener for more information.

§Translation notes

WARNING: implementing ClusterResourceListener delivers no cluster metadata: no client takes a reporter, as metric.reporters is class-valued.

Provided Methods§

Source

fn init(&self, metrics: &[Arc<KafkaMetric>])

This is called when the reporter is first registered to initially register all existing metrics.

§Arguments
  • metrics - All currently existing metrics
Source

fn metric_change(&self, metric: &Arc<KafkaMetric>)

This is called whenever a metric is updated or added.

§Arguments
  • metric - The metric that has been added or changed
Source

fn metric_removal(&self, metric: &Arc<KafkaMetric>)

This is called whenever a metric is removed.

§Arguments
  • metric - The metric that has been removed
Source

fn close(&self)

Called when the metrics repository is closed.

Implementors§