Skip to content

Group Filtering

By default Klag monitors every consumer group. On large or noisy clusters you usually want to narrow that down. Two settings control it:

VariableDefaultMeaning
METRICS_GROUP_FILTER*Comma-separated glob include patterns.
METRICS_GROUP_EXCLUDE(empty)Comma-separated glob exclude patterns.

A group is monitored iff it matches any include segment and no exclude segment.

Include only groups starting with ingest or categorize:

Terminal window
METRICS_GROUP_FILTER=ingest*,categorize*

Monitor everything except debug, canary, and shadow groups:

Terminal window
METRICS_GROUP_FILTER=*
METRICS_GROUP_EXCLUDE=debug-*,canary-*,*-shadow

METRICS_GROUP_FILTER and METRICS_GROUP_EXCLUDE are application-level filters. Cluster DESCRIBE permission is always required because listConsumerGroups() queries all groups before filtering happens. See ACL Permissions.

Filtering reduces the number of describe/offset calls Klag makes. For very large clusters, also tune KAFKA_CHUNK_COUNT and KAFKA_CHUNK_DELAY_MS (see the Configuration Reference) to spread requests over time and avoid spiking broker CPU.