Hi Kevin, I recently ran into.a case where the controllers and brokers were reporting a metadata version value in the metrics which was the minimum value even though the cluster had been previously finalized with a different value for the metadata version. After some investigation, this is because the MetadataLoaderMetrics configures the initial finalized value to the minimum version. If there is no active controller and the metadata state is never loaded, the metadata version reported is incorrect and causes confusion to the user.
I think we should fix this senamic in your new metrics. In other words, what should a kafka node report if the finazlied feature version is not known? I think that the kafka node should not expose metrics if the feature version is not known because the HWM is not known and the cluster metadata has not been loaded. For the implementation, once the metadata state has been loaded, the finalized feature version metrics can be created with their values. Any missing finalized feature version can be configured to its minimum value. This implementation would allow Kafka to report the correct value for the metric when both the metadata state is known and not report any metrics when the metadata state is unknown. What do you think? -- -José