Crates.io | rmq_monitor |
lib.rs | rmq_monitor |
version | 0.2.6 |
source | src |
created_at | 2020-04-29 21:27:08.225654 |
updated_at | 2023-04-12 13:44:08.874924 |
description | A simple tool which monitors RabbitMQ and notifies via Slack (legacy webhooks) when certain thresholds are met |
homepage | https://github.com/zbrox/rmq_monitor |
repository | https://github.com/zbrox/rmq_monitor |
max_upload_size | |
id | 235549 |
size | 95,636 |
This is a simple tool which monitors RabbitMQ queues and notifies via Slack (legacy webhooks) when certain thresholds are met.
This is published on crates.io so if you have cargo
setup you can just do:
cargo install rmq_monitor
-c, --config <config> Your TOML config file (default is config.toml)
The tool uses a TOML config file. If you don't pass any --config
argument it will look for a config.toml
in the working directory.
Triggers can be activated by a value either being above or below the given threshold. The default is above, but if you add trigger_when = "below"
to the trigger configuration it will be triggered when the given value falls below what you specify.
Here's a sample trigger definition to put in a config.toml file:
[[triggers]]
type = "messages_ready"
threshold = 10000
queue = "sent_images"
This trigger will activate and send a message when a queue called sent_images
goes above 10000 ready messages.
Here are the currently available triggers and their type field. If you put an invalid type for a trigger rmq_monitor
won't start up and print out the error due to inability to parse the config.
type = "consumers_total"
) - How many consumers are currently consuming from the queuetype = "memory_total"
) - Total memory used by the queuetype = "messages_total"
) - The total number of messages currently on the queuetype = "messages_ready"
) - The number of messages available to consumers, ready to be deliveredtype = "messages_unacknowledged"
) - The number of messages delivered to a consumer but not yet ackedtype = "messages_redelivered"
) - The number of redelivered messages (due to being rejected)type = "messages_total_rate"
) - The rate (per second) at which messages move in and out of the queuetype = "messages_ready_rate"
) - The rate (per second) at which ready messages changetype = "messages_unacknowledged_rate"
) - The rate (per second) at which unacknowledged messages changetype = "messages_publish_rate"
) - The rate (per second) at which messages are published on the queuetype = "messages_delivery_rate"
) - The rate (per second) at which messages are delivered by the queuetype = "messages_redeliver_rate"
) - The rate (per second) at which messages are redelivered to the queue (because of rejection)There's a minimal Docker image published on Docker hub. The size of the image is only 11Mb.
To use it you only need to mount a volume with your config file. The container will be looking for the config file in /config/config.toml
so mount it there. Example:
docker run -it -v (pwd)/your_config.toml:/config/config.toml --rm zbrox/rmq_monitor:latest
or if you're running in kubernetes and it's easier to mount the whole folder:
docker run -it -v (pwd)/where_i_keep_configs:/config --rm zbrox/rmq_monitor:latest
Obviously in this case you have to name the config file in that folder also config.toml
. Later I'll add a container variable to be able to change that name as well.