Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this KIP, we propose to add a new method to the Admin, Consumer, and Producer  interfaces. The KafkaAdminClient, KafkaConsumer, and KafkaProducer  will implement this new method.

Proposed Changes

The method registerMetricsForSubscriptionmethods registerMetricForSubscription and ungregisterMetricFromSubscription  will be added to the Admin, Consumer,  and Producer  interfaces.

...

Code Block
languagejava
firstline1
titleAdmin interface change
linenumberstrue
package org.apache.kafka.clients.admin;

public interface Admin extends AutoCloseable {  

/**
 *  ApplicationAn application metricsmetric provided for subscription.
 *  TheseThis metricsmetric will be added to this client's metrics
 *  that are available for subscription and sent as 
 *  telemetry data to the broker.
 *
 * @param metricsmetric, the application metricsmetric to register
 */ 
void registerMetricsForSubscription(Collection<? extends Metric> metrics)registerMetricForSubscription(KafkaMetric metric)

/**
 *  An application to be removed from subscription.
 *  This metric is removed from this client's metrics
 *  and will not be available for subscription.
 *
 * @param metric, the application metric to remove
 */ 
void unregisterMetricFromSubscription(KafkaMetric metric)


Code Block
languagejava
titleConsumer interface change
linenumberstrue
package org.apache.kafka.clients.consumer;

public interface Consumer<K, V> extends Closeable {
     

/**
 *  An Applicationapplication metricsmetric provided for subscription.
 *  TheseThis metricsmetric will be added to this client's metrics
 *  that are available for subscription and sent as 
 *  telemetry data to the broker.
 *
 * @param metricsmetric, the application metricsmetric to register
 */ 
void registerMetricForSubscription(KafkaMetric 
void registerMetricsForSubscription(Collection<? extends Metric> metricsmetric)

/**
 *  An application to be removed from subscription.
 *  This metric is removed from this client's metrics
 *  and will not be available for subscription.
 *
 * @param metric, the application metric to remove
 */ 
void unregisterMetricFromSubscription(KafkaMetric metric)


Code Block
languagejava
titleProducer interface changes
linenumberstrue
package org.apache.kafka.clients.producer;

public interface Producer<K, V> extends Closeable {     

/**
 *  An Applicationapplication metricsmetric provided for subscription.
 *  TheseThis metricsmetric will be added to this client's metrics
 *  that are available for subscription and sent as 
 *  telemetry data to the broker.
 *
 * @param metricsmetric, the application metricsmetric to register
 */  
void registerMetricsForSubscription(Collection<? extends Metric> metricsregisterMetricForSubscription(KafkaMetric metric)

/**
 *  An application to be removed from subscription.
 *  This metric is removed from this client's metrics
 *  and will not be available for subscription.
 *
 * @param metric, the application metric to remove
 */ 
void unregisterMetricFromSubscription(KafkaMetric metric)

Metrics naming

Since this KIP uses the entire telemetry metrics pipeline of KIP-714, the metrics naming and formatting will leverage the same process and rules found in KIP-714. 

...