Versions Compared

Key

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

...

  • Changes to public class Sensor.java to include Sensor.RecordLevel
  • addition Addition of static configuration string in CommonClientConfigs.java
  • Exposing that configuration string in StreamsConfig.java and KafkaConfig.scala since both use CommonClientConfigs.

Proposed Changes

  • The constructor of Sensor.java now takes a Sensor.RecordLevel as a parameter. This is an enum which has DEBUG and INFO record levels, and can be extended in future to include other levels.

...

  • The ClientConfig will have a new option called 'metrics.record.level' which is set to match the record levels of INFO or DEBUG while defining the consumer config.

  • In Sensor.java the shouldRecord() method is used to compare the value of metric record level in the consumer config and the RecordLevel associated with the sensor, to determine if metrics should recorded.

    From Sensor.java
     /** 
    * @return true if the sensor's record level indicates that the metric will be recorded, false otherwise
    */
    public boolean shouldRecord() {
    return this.recordLevel.shouldRecord(config.recordLevel());
    }

    From nested enum, Sensor.RecordLevel

    public boolean shouldRecord(final RecordLevel configLevel) {
    if (configLevel.equals(DEBUG)) {
    return true;
     } else {
    return configLevel.equals(this);
     }
    }

     

  • Further, since both StreamsConfig.java and KafkaConfig.scala use CommonClientConfigs, we also expose that field in both classes respectively.

Compatibility, Deprecation, and Migration Plan

...