You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Status

Current state"Under Discussion"

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: here [Change the link from KAFKA-1 to your own ticket]

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

A complex system like Kafka is non-trivial to operate. Metrics help users gauge how the system is behaving in real time. Kafka exposes metrics via JMX. Most users typically integrate these metrics with third-party systems which ease monitoring, detection of abnormal behavior and alerting.
When starting up a broker, most metrics will naturally not be populated since not much activity has happened. In this case, said metrics will output their default value.


In particular, Kafka has two classes which help the tracking of Max and Min statistics. Both classes respectively keep track of the maximum and minimum value they have recorded just fine.
The problem is that these metrics give out inconsistent with each other default values. Max gives out `-Inf`, whereas Min gives out `1.7976931348623157e+308` (Double.MAX_VALUE).

This is confusing at best and can cause third-party tool failures at worst. It is more intuitive to have these values be consistent.


Public Interfaces

The following metrics will now output `+Inf` default values rather than the previous `1.7976931348623157e+308` value.

  • kafka.consumer:type=consumer-fetch-manager-metrics,client-id=<CLIENT-ID> Attribute: records-lead-min
  • kafka.consumer:type=consumer-fetch-manager-metrics,client-id=<CLIENT-ID>,topic=<TOPIC>,partition=<PARTITION> Attribute: records-lead-min
  • kafka.streams:type=stream-record-cache-metrics,record-cache-id=all,task-id=<TASK-ID> Attribute: hitRatio-min

Proposed Changes

Change the Min stat's default value to be consistent with the Max stat's default value. Namely, change Min's default value to `+Inf`

Compatibility, Deprecation, and Migration Plan

The default value for the three metrics outlined above in "Public Interfaces" will change. If users' tools cannot handle `+Inf` as a default value, they will need to use some sort of workaround.

Rejected Alternatives

  • Change Max's default value to `4.9e-324` (Double.MIN_VALUE)
    • The Max stat is used in far more metrics than Min so it is better to change the one that is least used
    • -Inf and +Inf are more intuitive default values for Max and Min stats respectively
  • No labels