public interface MetricsReporter extends Reconfigurable, java.lang.AutoCloseable
Implement ClusterResourceListener
to receive cluster metadata once it's available. Please see the class documentation for ClusterResourceListener for more information.
Modifier and Type | Method and Description |
---|---|
void |
close()
Called when the metrics repository is closed.
|
default void |
contextChange(MetricsContext metricsContext)
Sets the context labels for the service or library exposing metrics.
|
void |
init(java.util.List<KafkaMetric> metrics)
This is called when the reporter is first registered to initially register all existing metrics
|
void |
metricChange(KafkaMetric metric)
This is called whenever a metric is updated or added
|
void |
metricRemoval(KafkaMetric metric)
This is called whenever a metric is removed
|
default java.util.Set<java.lang.String> |
reconfigurableConfigs()
Returns the names of configs that may be reconfigured.
|
default void |
reconfigure(java.util.Map<java.lang.String,?> configs)
Reconfigures this instance with the given key-value pairs.
|
default void |
validateReconfiguration(java.util.Map<java.lang.String,?> configs)
Validates the provided configuration.
|
configure
void init(java.util.List<KafkaMetric> metrics)
metrics
- All currently existing metricsvoid metricChange(KafkaMetric metric)
metric
- void metricRemoval(KafkaMetric metric)
metric
- void close()
close
in interface java.lang.AutoCloseable
default java.util.Set<java.lang.String> reconfigurableConfigs()
Reconfigurable
reconfigurableConfigs
in interface Reconfigurable
default void validateReconfiguration(java.util.Map<java.lang.String,?> configs) throws ConfigException
Reconfigurable
validateReconfiguration
in interface Reconfigurable
ConfigException
- if the provided configs are not valid. The exception
message from ConfigException will be returned to the client in
the AlterConfigs response.default void reconfigure(java.util.Map<java.lang.String,?> configs)
Reconfigurable
Configurable.configure(Map)
. This method will only be invoked if
the configs have passed validation using Reconfigurable.validateReconfiguration(Map)
.reconfigure
in interface Reconfigurable
@InterfaceStability.Evolving default void contextChange(MetricsContext metricsContext)
init(List)
and may be called anytime after that.metricsContext
- the metric context