[ 
https://issues.apache.org/jira/browse/KAFKA-18495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17968855#comment-17968855
 ] 

Mickael Maison commented on KAFKA-18495:
----------------------------------------

I stumbled on this by accident and I don't know the background or details, so 
ignore me if I say nonsense.

While we can't remove the metrics until the next major version, if this is 
really problematic, there's an approach we can use to workaround it.

We can introduce a new configuration, for example "remove.this.metric" which 
when set to true removes the metric. It would default to false, to keep the 
current behavior, and directly be marked as deprecated and to be removed in 
5.0.0.

While it's not great, we've used this mechanism a number of times in the past, 
for example 
[KIP-830|https://cwiki.apache.org/confluence/display/KAFKA/KIP-830%3A+Allow+disabling+JMX+Reporter].
 This lets users opt-in new behavior without having to wait, considering 5.0.0 
is potentially still pretty far off.

>  Remove Invalid 'numberOfOpenFiles' Metric from RocksDB State Store
> -------------------------------------------------------------------
>
>                 Key: KAFKA-18495
>                 URL: https://issues.apache.org/jira/browse/KAFKA-18495
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: streams
>    Affects Versions: 4.0.0
>            Reporter: Swikar Patel
>            Priority: Blocker
>              Labels: kip
>             Fix For: 5.0.0
>
>
> h1. *THIS TICKET CANNOT BE WORKED ON, UNTIL WE DO APACHE KAFKA 5.0 RELEASE.*
> The `numberOfOpenFiles` metric in the Kafka Streams RocksDB state store 
> implementation is currently invalid and should be removed.
> This metric was intended to report the approximate number of open files in 
> the RocksDB instance. It was previously calculated using the RocksDB internal 
> metric `NO_FILE_CLOSES`, which was removed in RocksDB version 9.7.3. Due to 
> this change, the `numberOfOpenFiles` metric no longer provides accurate 
> information. The current workaround is to have it always return -1, which is 
> misleading.
> The `numberOfOpenFiles` metric is: Invalid It does not reflect the actual 
> number of open files in RocksDB. This misleading and returning -1 can confuse 
> users and monitoring systems and unnecessary it provides no useful 
> information in its current state.
> h4. Proposed Solution
> This Jira issue is to implement the changes proposed in [KIP-1125: Remove 
> Invalid 'numberOfOpenFiles' Metric from RocksDB State 
> Store|https://cwiki.apache.org/confluence/display/KAFKA/KIP-1125%3A+Remove+Invalid+%27numberOfOpenFiles%27+Metric+from+RocksDB+State+Store].
>  The solution is to completely remove the `opennumberfiles` metric, including:
>  * Removing the related code in `RocksDBMetricsRecorder` 
> (`numberOfOpenFilesSensor`, recording logic).
>  * Removing the `numberOfOpenFilesSensor` method in `RocksDBMetrics`
>  * Updating the Kafka Streams documentation to reflect the metric's removal.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to