Bird
Raised Fist0

You want to monitor Kafka consumer lag using JMX metrics. Which ObjectName pattern should you use to query all consumer lag metrics for all topics?

hard🚀 Application Q8 of Q15
Kafka - Monitoring and Operations
You want to monitor Kafka consumer lag using JMX metrics. Which ObjectName pattern should you use to query all consumer lag metrics for all topics?
A"kafka.server:type=BrokerTopicMetrics,name=ConsumerLag"
B"kafka.consumer:type=consumer-lag-metrics,group=*"
C"kafka.consumer:type=consumer-fetch-manager-metrics,client-id=*,topic=*"
D"kafka.consumer:type=consumer-fetch-manager-metrics,client-id=*"
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct JMX domain and type for consumer lag

    Consumer lag metrics are under kafka.consumer with type consumer-fetch-manager-metrics.
  2. Step 2: Use wildcards for client-id and topic to get all metrics

    Using client-id=* and topic=* matches all consumers and topics.
  3. Final Answer:

    "kafka.consumer:type=consumer-fetch-manager-metrics,client-id=*,topic=*" -> Option C
  4. Quick Check:

    Consumer lag pattern = kafka.consumer with wildcards [OK]
Quick Trick: Use wildcards in ObjectName to query multiple metrics [OK]
Common Mistakes:
MISTAKES
  • Using wrong domain like kafka.server
  • Missing topic wildcard
  • Using non-existent type names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes