RabbitMQ + Management + Prometheus
Message broker with management UI and monitoring.
Overview
RabbitMQ is a robust, enterprise-grade message broker that implements the Advanced Message Queuing Protocol (AMQP) and serves as the backbone for distributed system communication. Originally developed by Rabbit Technologies in 2007 and later acquired by VMware, RabbitMQ has become the most widely deployed open-source message broker, handling millions of messages per second in production environments worldwide. Its strength lies in reliable message delivery, flexible routing capabilities, and support for multiple messaging protocols including AMQP, MQTT, and STOMP.
This monitoring stack combines RabbitMQ's management interface with Prometheus metrics collection and Grafana visualization to create a comprehensive observability solution. Prometheus scrapes metrics from RabbitMQ's built-in prometheus plugin (exposed on port 15692), while Grafana transforms this time-series data into actionable dashboards. The management UI provides real-time queue inspection and administrative controls, while Prometheus captures historical performance data for trend analysis and alerting.
Development teams building microservices architectures, platform engineers managing message-driven systems, and operations teams requiring deep visibility into message broker performance will find this stack invaluable. The combination provides both immediate troubleshooting capabilities through the management UI and long-term capacity planning insights through Grafana dashboards, making it essential for production RabbitMQ deployments.
Key Features
- AMQP 0-9-1 protocol implementation with message acknowledgments and persistent queues
- Built-in Prometheus metrics exporter providing queue depth, message rates, and connection statistics
- Web-based management interface for queue inspection, exchange configuration, and user management
- PromQL query language support for complex metric aggregation and alerting rules
- Multi-protocol support including MQTT for IoT devices and STOMP for web applications
- Grafana dashboard templating for monitoring multiple RabbitMQ clusters from single interface
- Dead letter exchange handling for failed message processing and debugging
- Time-series metric storage with configurable retention policies in Prometheus
Common Use Cases
- 1Microservices event-driven architectures requiring reliable inter-service communication monitoring
- 2IoT platforms processing MQTT messages with need for throughput and latency visibility
- 3E-commerce order processing systems monitoring queue backlogs and processing rates
- 4Task queue systems like Celery requiring worker performance and job completion tracking
- 5Financial services message processing with strict delivery guarantees and audit trails
- 6DevOps teams implementing infrastructure monitoring for message broker capacity planning
- 7Development environments requiring message flow debugging and performance optimization
Prerequisites
- Docker Engine 20.10+ and Docker Compose 2.0+ with at least 2GB available RAM
- Basic understanding of message queuing concepts and AMQP protocol fundamentals
- Familiarity with PromQL query language for creating custom Grafana dashboard panels
- Network ports 3000, 5672, 9090, 15672, and 15692 available on the host system
- Knowledge of RabbitMQ exchange types (direct, topic, fanout) for effective monitoring setup
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 rabbitmq: 3 image: rabbitmq:3-management4 environment: 5 - RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}6 - RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}7 volumes: 8 - rabbitmq-data:/var/lib/rabbitmq9 - ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro10 ports: 11 - "5672:5672"12 - "15672:15672"13 - "15692:15692"14 networks: 15 - rabbitmq-network16 restart: unless-stopped1718 prometheus: 19 image: prom/prometheus:latest20 command: 21 - --config.file=/etc/prometheus/prometheus.yml22 - --storage.tsdb.path=/prometheus23 volumes: 24 - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro25 - prometheus-data:/prometheus26 ports: 27 - "9090:9090"28 networks: 29 - rabbitmq-network30 restart: unless-stopped3132 grafana: 33 image: grafana/grafana:latest34 environment: 35 - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}36 volumes: 37 - grafana-data:/var/lib/grafana38 ports: 39 - "3000:3000"40 depends_on: 41 - prometheus42 networks: 43 - rabbitmq-network44 restart: unless-stopped4546volumes: 47 rabbitmq-data: 48 prometheus-data: 49 grafana-data: 5051networks: 52 rabbitmq-network: 53 driver: bridge.env Template
.env
1# RabbitMQ2RABBITMQ_USER=admin3RABBITMQ_PASSWORD=secure_rabbitmq_password4GRAFANA_PASSWORD=secure_grafana_password56# Enable prometheus plugin in rabbitmq.confUsage Notes
- 1AMQP at port 5672
- 2Management at http://localhost:15672
- 3Prometheus metrics at port 15692
- 4Grafana at http://localhost:3000
- 5Enable plugins: rabbitmq-plugins enable rabbitmq_prometheus
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
rabbitmq
rabbitmq:
image: rabbitmq:3-management
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
volumes:
- rabbitmq-data:/var/lib/rabbitmq
- ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
ports:
- "5672:5672"
- "15672:15672"
- "15692:15692"
networks:
- rabbitmq-network
restart: unless-stopped
prometheus
prometheus:
image: prom/prometheus:latest
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
ports:
- "9090:9090"
networks:
- rabbitmq-network
restart: unless-stopped
grafana
grafana:
image: grafana/grafana:latest
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
volumes:
- grafana-data:/var/lib/grafana
ports:
- "3000:3000"
depends_on:
- prometheus
networks:
- rabbitmq-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 rabbitmq:5 image: rabbitmq:3-management6 environment:7 - RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}8 - RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}9 volumes:10 - rabbitmq-data:/var/lib/rabbitmq11 - ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro12 ports:13 - "5672:5672"14 - "15672:15672"15 - "15692:15692"16 networks:17 - rabbitmq-network18 restart: unless-stopped1920 prometheus:21 image: prom/prometheus:latest22 command:23 - --config.file=/etc/prometheus/prometheus.yml24 - --storage.tsdb.path=/prometheus25 volumes:26 - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro27 - prometheus-data:/prometheus28 ports:29 - "9090:9090"30 networks:31 - rabbitmq-network32 restart: unless-stopped3334 grafana:35 image: grafana/grafana:latest36 environment:37 - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}38 volumes:39 - grafana-data:/var/lib/grafana40 ports:41 - "3000:3000"42 depends_on:43 - prometheus44 networks:45 - rabbitmq-network46 restart: unless-stopped4748volumes:49 rabbitmq-data:50 prometheus-data:51 grafana-data:5253networks:54 rabbitmq-network:55 driver: bridge56EOF5758# 2. Create the .env file59cat > .env << 'EOF'60# RabbitMQ61RABBITMQ_USER=admin62RABBITMQ_PASSWORD=secure_rabbitmq_password63GRAFANA_PASSWORD=secure_grafana_password6465# Enable prometheus plugin in rabbitmq.conf66EOF6768# 3. Start the services69docker compose up -d7071# 4. View logs72docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/rabbitmq-complete/run | bashTroubleshooting
- Connection refused on port 15692: Enable Prometheus plugin with 'rabbitmq-plugins enable rabbitmq_prometheus' command in container
- Grafana shows no data from Prometheus: Verify prometheus.yml contains correct RabbitMQ scrape target 'rabbitmq:15692'
- RabbitMQ management UI login fails: Check RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS environment variables are set
- High memory usage in RabbitMQ container: Configure message TTL and queue length limits in rabbitmq.conf file
- Prometheus target shows as down: Ensure rabbitmq_prometheus plugin is enabled and port 15692 is accessible between containers
- Missing metrics in Grafana dashboards: Import official RabbitMQ dashboard ID 10991 from Grafana dashboard library
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
rabbitmqprometheusgrafana
Tags
#rabbitmq#message-queue#amqp#broker#messaging
Category
Message Queues & BrokersAd Space
Shortcuts: C CopyF FavoriteD Download