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

Bruno Cadonna commented on KAFKA-14459:
---------------------------------------

Users might use their own statistics object if they want to collect and process 
their own RocksDB statistics outside of Kafka Streams. They could pass a 
statistics object into the config setter and then get the value they are 
interested in whenever they want from the passed in object and do whatever they 
want with those values. 
If users specify their own statistics object, Kafka Streams would not output 
statistics-based metrics for those RocksDB instances. I do not remember why we 
decided to do it that way, but maybe we could consider to do both, output 
statistics-based metrics and allow to pass its own statistics object. I can 
imagine that might be useful when users do not want to switch the metrics level 
to debug but still want to get some statistics about RocksDB or if they want to 
debug their metrics setup. However, the same statistics info might be also 
present in the RocksDB log files. I have never verified that. 

> Document how to use and close a 'Statistics' in the example 
> RocksDBConfigSetter
> -------------------------------------------------------------------------------
>
>                 Key: KAFKA-14459
>                 URL: https://issues.apache.org/jira/browse/KAFKA-14459
>             Project: Kafka
>          Issue Type: Improvement
>          Components: docs, streams
>            Reporter: A. Sophie Blee-Goldman
>            Priority: Major
>              Labels: docs, newbie
>
> We fixed a memory leak in KAFKA-14432 where we were sometimes failing to 
> close the `Statistics` object used for rocksdb metrics. Since users can 
> define their own Statistics as well, we should make sure they know that this 
> has to be closed like we do for other `RocksDBObject` classes like the Cache. 
> It might also be useful to provide an example of how to use Statistics and 
> what can be done with it.
>  
> We currently have two sample RocksDBConfigSetter implementations in the docs, 
> both of which could be updated here:
>  # ([rocksdb memory management 
> docs|https://kafka.apache.org/documentation/streams/developer-guide/memory-mgmt.html#rocksdb])
>  – consider including a Statistics in this example to highlight that it needs 
> to be closed? This one could arguably be skipped, although the formatting of 
> this sample config setter seems to be messed up so this might be a good 
> opportunity to fix that on the side
>  # [rocksdb.config.setter config 
> docs|https://kafka.apache.org/documentation/streams/developer-guide/config-streams.html#id20):]
>  –  this would be a good place to include an example that actually uses the 
> Statistics for something (assuming there's some reason for users to define 
> their own Statistics in the first place, which I personally do not know). We 
> can potentially link to this example from the metrics docs



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

Reply via email to