0
0
RabbitMQdevops~10 mins

Alerting on queue depth and consumer lag in RabbitMQ - Interactive Code Practice

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

Complete the code to check the current depth of a RabbitMQ queue using the CLI.

RabbitMQ
rabbitmqctl list_queues -p / name messages_ready [1]
Drag options to blanks, or click blank then click option'
A--vhost=/
B--all
C--queue
D--depth
Attempts:
3 left
💡 Hint
Common Mistakes
Using an option that does not exist like --depth
Omitting the virtual host option
2fill in blank
medium

Complete the command to get consumer lag metrics from RabbitMQ management API using curl.

RabbitMQ
curl -u guest:guest http://localhost:15672/api/queues/[1]/myqueue
Drag options to blanks, or click blank then click option'
A%2F
Bqueue
Capi
Dmanagement
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'queue' instead of the virtual host name in the URL
Missing URL encoding for special characters in vhost
3fill in blank
hard

Fix the error in the Prometheus alert rule to trigger when queue depth exceeds 1000.

RabbitMQ
alert: HighQueueDepth
expr: rabbitmq_queue_messages_ready > [1]
for: 5m
labels:
  severity: warning
annotations:
  summary: "Queue depth is high"
Drag options to blanks, or click blank then click option'
A1k
B"1000"
C1000m
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the number in quotes causing a syntax error
Using units like 'm' or 'k' which Prometheus does not parse
4fill in blank
hard

Fill both blanks to create a Prometheus alert that triggers when consumer lag is above 500 for 10 minutes.

RabbitMQ
alert: HighConsumerLag
expr: rabbitmq_consumer_lag [1] [2]
for: 10m
labels:
  severity: critical
annotations:
  summary: "Consumer lag is too high"
Drag options to blanks, or click blank then click option'
A>
B500
C<
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than operator instead of greater than
Setting the threshold too high or too low
5fill in blank
hard

Fill all three blanks to define a Prometheus alert that fires when queue depth is above 1000 and consumer lag is above 200.

RabbitMQ
alert: QueueDepthAndLagHigh
expr: rabbitmq_queue_messages_ready [1] [2] and rabbitmq_consumer_lag [3] 200
for: 5m
labels:
  severity: critical
annotations:
  summary: "Queue depth and consumer lag are high"
Drag options to blanks, or click blank then click option'
A>
B1000
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect operators like less than
Mixing up threshold values