Bird
Raised Fist0
RabbitMQdevops~20 mins

Prometheus and Grafana integration in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Prometheus and Grafana Integration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Prometheus RabbitMQ Exporter Metrics Output
You run the RabbitMQ Prometheus exporter and query the metric rabbitmq_queue_messages_ready. What output do you expect if the queue task_queue has 5 ready messages?
RabbitMQ
curl http://localhost:9419/metrics | grep rabbitmq_queue_messages_ready
Arabbitmq_queue_messages_ready{queue="task_queue",vhost="/"} 0
Brabbitmq_queue_messages_ready{queue="task_queue"} 0
Crabbitmq_queue_messages_ready{queue="task_queue",vhost="/"} 5
Drabbitmq_queue_messages_ready 5
Attempts:
2 left
💡 Hint
Look for the metric with the correct labels showing the queue name and virtual host.
❓ Configuration
intermediate
2:00remaining
Grafana Data Source Setup for Prometheus
Which configuration snippet correctly sets up a Prometheus data source in Grafana to scrape metrics from http://localhost:9090?
A
apiVersion: 1
datasources:
- name: Prometheus
  type: prometheus
  access: proxy
  url: http://localhost:9090
  isDefault: true
B
apiVersion: 1
datasources:
- name: Prometheus
  type: prometheus
  access: direct
  url: http://localhost:9419
  isDefault: false
C
apiVersion: 1
datasources:
- name: Prometheus
  type: influxdb
  access: proxy
  url: http://localhost:9090
  isDefault: true
D
apiVersion: 1
datasources:
- name: RabbitMQ
  type: prometheus
  access: proxy
  url: http://localhost:9090
  isDefault: true
Attempts:
2 left
💡 Hint
Check the data source type and URL for Prometheus.
🔀 Workflow
advanced
3:00remaining
Order of Steps to Integrate RabbitMQ Metrics into Grafana
What is the correct order of steps to integrate RabbitMQ metrics into Grafana using Prometheus?
A2,1,3,4
B1,2,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Think about enabling metrics first, then scraping, then visualization setup.
❓ Troubleshoot
advanced
2:30remaining
Troubleshooting Missing RabbitMQ Metrics in Grafana
You see no RabbitMQ metrics in Grafana dashboards after setup. Which is the most likely cause?
APrometheus is not scraping the RabbitMQ metrics endpoint correctly
BGrafana dashboards are missing the Prometheus data source
CRabbitMQ server is down but Prometheus is scraping metrics
DRabbitMQ metrics are visible in Prometheus but Grafana shows no data due to dashboard refresh rate
Attempts:
2 left
💡 Hint
Check if Prometheus can access the metrics endpoint first.
✅ Best Practice
expert
3:00remaining
Best Practice for Securing Prometheus Metrics Endpoint for RabbitMQ
Which option is the best practice to secure the RabbitMQ Prometheus metrics endpoint in a production environment?
AExpose the metrics endpoint publicly without authentication for easy access
BEmbed RabbitMQ credentials in Prometheus scrape config without encryption
CDisable TLS and use plain HTTP for metrics to reduce complexity
DUse network policies or firewall rules to restrict access to the metrics endpoint
Attempts:
2 left
💡 Hint
Think about limiting who can see sensitive metrics data.

Practice

(1/5)
1. What is the first step to enable monitoring of RabbitMQ metrics using Prometheus?
easy
A. Configure Prometheus scrape interval
B. Enable the RabbitMQ Prometheus plugin
C. Install Grafana dashboard
D. Restart the RabbitMQ server

Solution

  1. Step 1: Enable RabbitMQ Prometheus plugin

    This plugin exposes RabbitMQ metrics in a format Prometheus can scrape.
  2. Step 2: Confirm plugin activation

    Use rabbitmq-plugins enable rabbitmq_prometheus to activate it.
  3. Final Answer:

    Enable the RabbitMQ Prometheus plugin -> Option B
  4. Quick Check:

    Enable plugin = C [OK]
Hint: Start by enabling the Prometheus plugin in RabbitMQ [OK]
Common Mistakes:
  • Trying to configure Prometheus before enabling the plugin
  • Assuming Grafana setup is the first step
  • Restarting RabbitMQ without enabling the plugin
2. Which of the following is the correct Prometheus scrape configuration snippet to monitor RabbitMQ metrics?
easy
A. scrape_configs: - job_name: 'rabbitmq' static_configs: - targets: ['localhost:15692']
B. scrape_configs: - job_name: 'rabbitmq' static_configs: - targets: ['localhost:5672']
C. scrape_configs: - job_name: 'rabbitmq' static_configs: - targets: ['localhost:15672']
D. scrape_configs: - job_name: 'rabbitmq' static_configs: - targets: ['localhost:9090']

Solution

  1. Step 1: Identify RabbitMQ Prometheus metrics port

    The Prometheus plugin exposes metrics on port 15692 by default.
  2. Step 2: Verify scrape target in Prometheus config

    The target must be localhost:15692 to scrape RabbitMQ metrics correctly.
  3. Final Answer:

    scrape_configs with target localhost:15692 -> Option A
  4. Quick Check:

    Port 15692 for Prometheus metrics = A [OK]
Hint: Use port 15692 for RabbitMQ Prometheus metrics scrape [OK]
Common Mistakes:
  • Using RabbitMQ AMQP port 5672 instead of metrics port
  • Using RabbitMQ management port 15672 incorrectly
  • Using Prometheus default port 9090 as target
3. Given this Prometheus scrape config snippet, what will be the result when Prometheus scrapes RabbitMQ metrics?
scrape_configs:
  - job_name: 'rabbitmq'
    static_configs:
      - targets: ['rabbitmq-server:15692']
medium
A. Prometheus will fail due to wrong port
B. Prometheus will ignore this job
C. Prometheus will collect metrics but with errors
D. Prometheus will collect RabbitMQ metrics successfully

Solution

  1. Step 1: Check target hostname and port

    The target rabbitmq-server:15692 is valid if DNS resolves and port 15692 is open.
  2. Step 2: Confirm Prometheus plugin exposes metrics on port 15692

    This matches the default port for RabbitMQ Prometheus plugin metrics.
  3. Final Answer:

    Prometheus will collect RabbitMQ metrics successfully -> Option D
  4. Quick Check:

    Correct hostname and port = B [OK]
Hint: Correct hostname and port means successful scrape [OK]
Common Mistakes:
  • Assuming port 15692 is incorrect
  • Ignoring hostname resolution issues
  • Confusing management port with metrics port
4. You configured Prometheus to scrape RabbitMQ metrics but see no data in Grafana dashboards. What is the most likely cause?
medium
A. Prometheus scrape interval is too long
B. Grafana is not installed
C. RabbitMQ Prometheus plugin is not enabled
D. RabbitMQ server is down

Solution

  1. Step 1: Check if RabbitMQ Prometheus plugin is enabled

    If the plugin is disabled, no metrics are exposed for Prometheus to scrape.
  2. Step 2: Confirm plugin activation with rabbitmq-plugins list

    This command shows enabled plugins; absence of rabbitmq_prometheus means no metrics.
  3. Final Answer:

    RabbitMQ Prometheus plugin is not enabled -> Option C
  4. Quick Check:

    Plugin disabled = no metrics = A [OK]
Hint: Check plugin enabled before blaming Grafana or Prometheus [OK]
Common Mistakes:
  • Assuming Grafana installation causes no data
  • Blaming scrape interval without checking metrics exposure
  • Ignoring RabbitMQ server status
5. You want to create a Grafana dashboard to monitor RabbitMQ queue length over time. Which data source and query setup is correct?
hard
A. Use Prometheus data source; query rabbitmq_queue_messages_ready
B. Use RabbitMQ data source; query queue_length
C. Use Prometheus data source; query rabbitmq_queue_consumers
D. Use Grafana Loki data source; query queue_length_logs

Solution

  1. Step 1: Identify correct data source for RabbitMQ metrics

    Prometheus is used to collect and store RabbitMQ metrics exposed by the plugin.
  2. Step 2: Select the metric for queue length

    rabbitmq_queue_messages_ready represents the number of messages ready in queues.
  3. Final Answer:

    Use Prometheus data source; query rabbitmq_queue_messages_ready -> Option A
  4. Quick Check:

    Prometheus + rabbitmq_queue_messages_ready = D [OK]
Hint: Use Prometheus and metric rabbitmq_queue_messages_ready for queue length [OK]
Common Mistakes:
  • Using RabbitMQ data source which is not standard for Grafana
  • Querying consumers count instead of queue length
  • Using Loki which is for logs, not metrics
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard