public class JmxReporter extends Object implements MetricsReporter
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_EXCLUDE |
static String |
DEFAULT_INCLUDE |
static String |
EXCLUDE_CONFIG |
static String |
EXCLUDE_CONFIG_ALIAS |
static String |
INCLUDE_CONFIG |
static String |
INCLUDE_CONFIG_ALIAS |
static String |
METRICS_CONFIG_PREFIX |
static Set<String> |
RECONFIGURABLE_CONFIGS |
| Constructor and Description |
|---|
JmxReporter() |
JmxReporter(String prefix)
Deprecated.
Since 2.6.0. Use
JmxReporter()
Initialize JmxReporter with contextChange(MetricsContext)
Populate prefix by adding _namespace/prefix key value pair to MetricsContext |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Called when the metrics repository is closed.
|
static Predicate<String> |
compilePredicate(Map<String,?> originalConfig) |
void |
configure(Map<String,?> configs)
Configure this class with the given key-value pairs
|
boolean |
containsMbean(String mbeanName) |
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
|
Set<String> |
reconfigurableConfigs()
Returns the names of configs that may be reconfigured.
|
void |
reconfigure(Map<String,?> configs)
Reconfigures this instance with the given key-value pairs.
|
void |
validateReconfiguration(Map<String,?> configs)
Validates the provided configuration.
|
public static final String METRICS_CONFIG_PREFIX
public static final String EXCLUDE_CONFIG
public static final String EXCLUDE_CONFIG_ALIAS
public static final String INCLUDE_CONFIG
public static final String INCLUDE_CONFIG_ALIAS
public static final String DEFAULT_INCLUDE
public static final String DEFAULT_EXCLUDE
public JmxReporter()
@Deprecated public JmxReporter(String prefix)
JmxReporter()
Initialize JmxReporter with contextChange(MetricsContext)
Populate prefix by adding _namespace/prefix key value pair to MetricsContextpublic void configure(Map<String,?> configs)
Configurableconfigure in interface Configurablepublic Set<String> reconfigurableConfigs()
ReconfigurablereconfigurableConfigs in interface MetricsReporterreconfigurableConfigs in interface Reconfigurablepublic void validateReconfiguration(Map<String,?> configs) throws ConfigException
ReconfigurablevalidateReconfiguration in interface MetricsReportervalidateReconfiguration in interface ReconfigurableConfigException - if the provided configs are not valid. The exception
message from ConfigException will be returned to the client in
the AlterConfigs response.public void reconfigure(Map<String,?> configs)
ReconfigurableConfigurable.configure(Map). This method will only be invoked if
the configs have passed validation using Reconfigurable.validateReconfiguration(Map).reconfigure in interface MetricsReporterreconfigure in interface Reconfigurablepublic void init(List<KafkaMetric> metrics)
MetricsReporterinit in interface MetricsReportermetrics - All currently existing metricspublic boolean containsMbean(String mbeanName)
public void metricChange(KafkaMetric metric)
MetricsReportermetricChange in interface MetricsReporterpublic void metricRemoval(KafkaMetric metric)
MetricsReportermetricRemoval in interface MetricsReporterpublic void close()
MetricsReporterclose in interface AutoCloseableclose in interface MetricsReporterpublic void contextChange(MetricsContext metricsContext)
MetricsReporterMetricsReporter.init(List) and may be called anytime after that.contextChange in interface MetricsReportermetricsContext - the metric context