0
0
Kafkadevops~10 mins

JMX metrics in Kafka - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the JMX port for Kafka broker.

Kafka
KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote.port=[1]"
Drag options to blanks, or click blank then click option'
A9999
B9092
C2181
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using Kafka broker port 9092 as JMX port.
Using Zookeeper port 2181 as JMX port.
2fill in blank
medium

Complete the code to enable JMX remote access without authentication.

Kafka
KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.authenticate=[1]"
Drag options to blanks, or click blank then click option'
Ano
Byes
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'no' or 'yes' instead of boolean false or true.
Setting authentication to true when trying to disable it.
3fill in blank
hard

Fix the error in the JMX options to enable SSL for JMX remote connections.

Kafka
KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.ssl=[1]"
Drag options to blanks, or click blank then click option'
Atrue
Benable
Con
Dyes
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' or 'yes' instead of true.
Using uppercase True which may cause issues.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that collects JMX metrics for topics with names longer than 5 characters.

Kafka
metrics = {topic: metrics_data[topic][1] for topic in topics if len(topic) [2] 5}
Drag options to blanks, or click blank then click option'
A["message_count"]
B>
C<
D['bytes_in']
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses instead of square brackets for dictionary keys.
Using less than '<' instead of greater than '>' in condition.
5fill in blank
hard

Fill all three blanks to filter and transform JMX metrics into a new dictionary with uppercase topic names and only metrics with values above 100.

Kafka
filtered_metrics = [1]: metrics_data[topic] for topic in topics if metrics_data[topic][[2]] [3] 100
Drag options to blanks, or click blank then click option'
Atopic.upper()
B'message_count'
C>
D'bytes_in'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase topic names instead of uppercase.
Filtering on 'bytes_in' instead of 'message_count'.
Using '<' instead of '>' in the condition.