I am reading this question Kafka: Continuously getting FETCH_SESSION_ID_NOT_FOUND, and I am trying to apply the solution suggested by Hrishikesh Mishra, as we also face the
The metric named kafka.server:type=FetchSessionCache,name=NumIncrementalFetchSessions
is the correct way to monitor the number of FetchSessions.
The size is configurable via max.incremental.fetch.session.cache.slots
. Note that this setting is applied per-broker, so each broker can cache up to max.incremental.fetch.session.cache.slots
sessions.
The other metric you saw, kafka.server:type=FetchSessionCache,name=NumIncrementalFetchPartitionsCached
, is the total number of partitions used across all FetchSession. Many FetchSessions will used several partitions so it's expected to see a larger number of them.
As you said, the low number of FetchSessions you saw was likely due to the restart.