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§
Sourcefn init(&self, metrics: &[Arc<KafkaMetric>])
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
Sourcefn metric_change(&self, metric: &Arc<KafkaMetric>)
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