- Polls metrics from RabbitMQ HTTP API:
/api/queues
. - For each queue, calculates queue usage vs.
max-length
ormax-length-bytes
policy if such policy exists. - Logs the metrics into Grafana Loki.
- Shows a time series graph for each
vhost+queue
based on the above Loki data source.
NOTE: this example can be used for any other custom metrics
- RabbitMQ
- Grafana
- Grafana Loki
sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0
Follow instructions
sudo systemctl start grafana-server
sudo apt-get install loki promtail
sudo systemctl start loki
sudo systemctl enable loki
sudo systemctl status loki
- Choose Loki datasource & enter the URL, e.g.
http://localhost:3100
- Add query
- Add a label filter
service_name: rabbitmq-queue-utilization
- Add data transformations:
- Extract fields, Source: Line, Format: Auto
- Extract fields, format: key+value pairs, Replace All Fields, Keep Time
- Convert field type: Time => Time
- Convert field type: utilisation => Number
- Add field from calculation: Binary op, utilisation * 100, alias:
utilization_percent
- Filter fields by name (all except utilisation)
- Partition by:
vhost
,queue