public interface MetricsReporter extends Reconfigurable, 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(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 Set<String> |
reconfigurableConfigs()
Returns the names of configs that may be reconfigured.
|
default void |
reconfigure(Map<String,?> configs)
Reconfigures this instance with the given key-value pairs.
|
default void |
validateReconfiguration(Map<String,?> configs)
Validates the provided configuration.
|
configure
void init(List<KafkaMetric> metrics)
metrics
- All currently existing metricsvoid metricChange(KafkaMetric metric)
metric
- void metricRemoval(KafkaMetric metric)
metric
- void close()
close
in interface AutoCloseable
default Set<String> reconfigurableConfigs()
Reconfigurable
reconfigurableConfigs
in interface Reconfigurable
default void validateReconfiguration(Map<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(Map<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