I use redis with my springboot application. The memory policy is lfu
and would like to see the statistics of hotkeys.
One way is to connect to redis and run
./redis-cli --hotkeys
But it would be better to monitor the top x hotkeys, and present it in grafana dashboard via Prometheus. Can it be achieved in Redis server metrics? or I should use a redis client library and let it collect the key retrieved in the springboot application?
At its current (v5.0.5) version, Redis does not provide a convenient way to collect "hot keys", meaning there is no single command that returns that. What you can do is either use the cli (as noted) or rewrite its logic (scanning and calling OBJECT FREQ
on each key) in your app.