Lifeguard integration with RabbitMQ
Project description
Lifeguard RabbitMQ
Usage
Configure plugin in lifeguard_settings.py
.
import lifeguard_rabbitmq
PLUGINS = [lifeguard_rabbitmq]
Settings
Name | Description | Value |
---|---|---|
LIFEGUARD_RABBITMQ_\w+_ADMIN_BASE_URL | RabbitMQ admin base url of default instance | http://localhost:15672 |
LIFEGUARD_RABBITMQ_\w+_ADMIN_USER | RabbitMQ admin user of default instance | guest |
LIFEGUARD_RABBITMQ_\w+_ADMIN_PASSWD | RabbitMQ admin password of default instance | guest |
LIFEGUARD_RABBITMQ_\w+_ADMIN_VHOST | RabbitMQ admin virtual host of default instance | / |
LIFEGUARD_RABBITMQ_INSTANCES | List of rabbitmq instances separated by comma | default |
Builtin Validations
Consumers Running Validation
Usage example:
# in lifeguard_settings.py
from lifeguard_rabbitmq import RABBITMQ_PLUGIN_CONTEXT
from lifeguard import NORMAL, PROBLEM
from lifeguard.actions.email import send_email
RABBITMQ_PLUGIN_CONTEXT.consumers_validation_options = {
"actions": [send_email],
"schedule": {"every": {"minutes": 1}},
"settings": {
"email": {
"subject": "[Lifeguard] - Consumers validation",
"receivers": [{"name": "User", "email": "user@cserver.com"}],
"send_in": [PROBLEM],
"remove_from_sent_list_when": [NORMAL],
}
},
"queues": {
"default": [{"name": "lifeguard.queue.example", "min_number_of_consumers": 1}],
},
}
Messages Increasing Validation
Usage example:
# in lifeguard_settings.py
from lifeguard_rabbitmq import RABBITMQ_PLUGIN_CONTEXT
from lifeguard import NORMAL, PROBLEM
from lifeguard.actions.database import save_result_into_database
RABBITMQ_PLUGIN_CONTEXT.messages_increasing_validation_options = {
"actions": [save_result_into_database],
"schedule": {"every": {"minutes": 1}},
"settings": {},
"queues": {
"default": [{"name": "lifeguard.queue.example", "count_before_alert": 10}],
},
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for lifeguard_rabbitmq-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe7b01788cf31a634d853bf1b7b5a537073c2cf9bc91b1ad1e44fb5a3f3423e1 |
|
MD5 | 6e2591bbeabdbefd70e68f3454a4d83c |
|
BLAKE2b-256 | b0b5b6af71f835d4062176cd520e12aef3a37326527cc558c6101c11f3019151 |