Skip to main content

Lifeguard integration with RabbitMQ

Project description

Lifeguard RabbitMQ

SourceLevel

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

lifeguard-rabbitmq-1.0.0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

lifeguard_rabbitmq-1.0.0-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page