jsancio commented on code in PR #20021: URL: https://github.com/apache/kafka/pull/20021#discussion_r2175206091
########## metadata/src/main/java/org/apache/kafka/image/loader/MetadataLoader.java: ########## @@ -345,7 +347,23 @@ private void maybePublishMetadata(MetadataDelta delta, MetadataImage image, Load } } metrics.updateLastAppliedImageProvenance(image.provenance()); - metrics.setCurrentMetadataVersion(image.features().metadataVersionOrThrow()); + MetadataVersion metadataVersion = image.features().metadataVersionOrThrow(); + metrics.setCurrentMetadataVersion(metadataVersion); + + // Set the metadata version feature level, since it is handled separately from other features + metrics.recordFinalizedFeatureLevel( + MetadataVersion.FEATURE_NAME, + metadataVersion.featureLevel() + ); + + // Set all production feature levels from the image, defaulting to their minimum production values + for (var feature : Feature.PRODUCTION_FEATURES) { Review Comment: > IIUC, we should only expose the finalizedLevel metrics for features that actually have a finalized level? If the feature does not have a finalized level, it does not have a finalizedLevel metric? Yes. Let's implement this definition. Sorry for the confusion and back and forth. Please feel free to update the KIP. This also means that if the finalized feature version is "removed" (set to 0), the code needs to remove the associated metric. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org