A Kafka broker is a server that stores data and serves clients. It handles read and write requests for topics and manages data replication.
Click to reveal answer
beginner
What does the MessagesInPerSec metric measure in a Kafka broker?
It measures the number of messages the broker receives per second from producers.
Click to reveal answer
intermediate
Explain the UnderReplicatedPartitions metric.
This metric shows how many partitions have fewer replicas in sync than expected, indicating potential data loss risk.
Click to reveal answer
intermediate
What does the RequestHandlerAvgIdlePercent metric indicate?
It shows the average percentage of time the broker's request handler threads are idle, helping to understand broker load.
Click to reveal answer
beginner
Why is monitoring BytesInPerSec and BytesOutPerSec important?
These metrics track the data volume flowing into and out of the broker, helping to detect bottlenecks or unusual traffic.
Click to reveal answer
Which Kafka broker metric shows the number of messages received per second?
ARequestHandlerAvgIdlePercent
BBytesOutPerSec
CUnderReplicatedPartitions
DMessagesInPerSec
✗ Incorrect
MessagesInPerSec counts how many messages the broker receives each second.
What does a high value in UnderReplicatedPartitions mean?
ASome partitions have fewer replicas than expected
BMore partitions are fully replicated
CBroker is idle
DHigh message throughput
✗ Incorrect
UnderReplicatedPartitions indicates partitions with fewer replicas in sync, which is risky.
If RequestHandlerAvgIdlePercent is very low, what does it suggest?
ABroker threads are mostly idle
BNo messages are being processed
CBroker threads are mostly busy
DBroker is offline
✗ Incorrect
Low idle percent means request handler threads are busy handling requests.
Which metric helps monitor the data volume sent from the broker to consumers?
ABytesInPerSec
BBytesOutPerSec
CMessagesInPerSec
DUnderReplicatedPartitions
✗ Incorrect
BytesOutPerSec tracks data sent out from the broker.
Why is it important to monitor BytesInPerSec?
ATo track data volume coming into the broker
BTo measure broker CPU usage
CTo check how many messages are consumed
DTo count under-replicated partitions
✗ Incorrect
BytesInPerSec measures the data volume entering the broker from producers.
Describe the key Kafka broker metrics you would monitor to ensure broker health and performance.
Think about message flow, replication status, and thread activity.
You got /5 concepts.
Explain why UnderReplicatedPartitions is critical for Kafka reliability.
Consider what happens if replicas are not in sync.
You got /4 concepts.
Practice
(1/5)
1.
What does the MessagesInPerSec metric in Kafka broker monitoring indicate?
easy
A. The number of messages the broker receives per second
B. The number of active connections to the broker
C. The total disk space used by the broker
D. The number of partitions in the broker
Solution
Step 1: Understand the metric name
The metric MessagesInPerSec literally means messages coming in per second to the broker.
Step 2: Match the metric to its meaning
This metric counts how many messages the broker receives every second, showing its input load.
Final Answer:
The number of messages the broker receives per second -> Option A
Quick Check:
MessagesInPerSec = messages received per second [OK]
Hint: Look for 'In' to find incoming message rate [OK]
Common Mistakes:
Confusing message count with connection count
Thinking it measures disk usage
Mixing it up with partition count
2.
Which of the following is the correct JMX metric name to monitor the broker's outgoing bytes per second?
easy
A. MessagesOutPerSec
B. BytesInPerSec
C. BytesOutPerSec
D. BytesTotalPerSec
Solution
Step 1: Identify the direction of data flow
Outgoing bytes means data sent out from the broker, so the metric should say 'Out'.
Step 2: Match the exact metric name
The correct metric for outgoing bytes per second is BytesOutPerSec.
Final Answer:
BytesOutPerSec -> Option C
Quick Check:
Outgoing bytes = BytesOutPerSec [OK]
Hint: Look for 'Out' and 'Bytes' in metric name [OK]
Common Mistakes:
Choosing BytesInPerSec which is incoming data
Confusing messages with bytes
Using a non-existent metric name
3.
Given the following JMX metric values for a Kafka broker: MessagesInPerSec = 500 BytesInPerSec = 1024000 BytesOutPerSec = 2048000 What does this tell you about the broker's activity?
medium
A. The broker's incoming and outgoing bytes are equal
B. The broker is receiving more messages than it sends out
C. The broker is idle with no message traffic
D. The broker is sending out twice as much data as it receives in messages
Solution
Step 1: Analyze the metric values
MessagesInPerSec is 500, BytesInPerSec is 1,024,000 bytes, BytesOutPerSec is 2,048,000 bytes.
Step 2: Compare incoming and outgoing bytes
Outgoing bytes (2,048,000) is exactly twice the incoming bytes (1,024,000), meaning the broker sends out twice as much data as it receives.
Final Answer:
The broker is sending out twice as much data as it receives in messages -> Option D
Quick Check:
BytesOutPerSec = 2 x BytesInPerSec [OK]
Hint: Compare BytesOutPerSec and BytesInPerSec values [OK]
Common Mistakes:
Ignoring the difference between bytes and messages
Assuming equal incoming and outgoing bytes
Misreading the numeric values
4.
Consider this snippet monitoring Kafka broker metrics in Java:
A. The code does not handle the case when bytesIn equals bytesOut
B. The comparison should use >= to handle equal values
C. The metric names are incorrect and will cause an error
D. The JMX attribute values should be cast to int, not double
Solution
Step 1: Review the if-else logic
The code checks if bytesIn is greater than bytesOut, else prints "More outgoing data".
Step 2: Identify missing case handling
If bytesIn equals bytesOut, the else block runs, printing "More outgoing data" which is misleading.
Final Answer:
The code does not handle the case when bytesIn equals bytesOut -> Option A
Quick Check:
Equal values need explicit handling [OK]
Hint: Check if equal values are handled in if-else [OK]
Common Mistakes:
Assuming metric names are wrong
Ignoring equal value scenario
Casting to wrong data type without error
5.
You want to alert if the Kafka broker's RequestHandlerAvgIdlePercent metric drops below 20%, indicating high load. Which approach correctly implements this check in pseudocode?
1. Fetch RequestHandlerAvgIdlePercent metric value 2. If value < 20 then alert 'High broker load'
hard
A. if (RequestHandlerAvgIdlePercent > 20) { alert('High broker load'); }
B. if (RequestHandlerAvgIdlePercent < 20) { alert('High broker load'); }
C. if (RequestHandlerAvgIdlePercent == 20) { alert('High broker load'); }
D. if (RequestHandlerAvgIdlePercent != 20) { alert('High broker load'); }
Solution
Step 1: Understand the metric meaning
RequestHandlerAvgIdlePercent shows how idle the request handler threads are; lower means busier.
Step 2: Apply the alert condition
If this value is less than 20%, it means the broker is busy, so alerting on < 20 is correct.
Final Answer:
if (RequestHandlerAvgIdlePercent < 20) { alert('High broker load'); } -> Option B
Quick Check:
Idle percent < 20 means high load [OK]
Hint: Alert when idle percent is less than threshold [OK]
Common Mistakes:
Using greater than instead of less than
Checking equality only
Using not equal which triggers too often
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.