Skip to main content

Log server for RabbitMQ consumer.

Project description

python3-cyberfusion-rabbitmq-consumer-log-server

Log server for RabbitMQ consumer.

Use the RabbitMQ consumer? The log server gives you an overview of RPC requests/responses - from all your RabbitMQ consumers - in one place.

RPC requests overview

RPC request detail

Install

PyPI

Run the following command to install the package from PyPI:

pip3 install python3-cyberfusion-rabbitmq-consumer-log-server

Debian

Run the following commands to build a Debian package:

mk-build-deps -i -t 'apt -o Debug::pkgProblemResolver=yes --no-install-recommends -y'
dpkg-buildpackage -us -uc

Configure

The log server consists of two parts: a web-based GUI, and an API.

API

The RabbitMQ consumer writes RPC requests/responses to the API. To let the consumer ship logs to the log server, see the consumer's README.

In the consumer, an API token must be set. Set it in /etc/rabbitmq-consumer-log-server/api_token (regular text file).

You can generate a random API token using openssl: openssl rand -hex 32

You don't need to keep the API token confidential: it's only used by the RabbitMQ consumer to write logs. Therefore, abuse would be a nuisance at the worst, not a data breach.

GUI

Use the web-based GUI to view RPC requests/responses.

The web GUI uses basic authentication. Set a password in /etc/rabbitmq-consumer-log-server/gui_password (regular text file).

You can generate a random password using openssl: openssl rand -hex 32

You can use any basic authentication username - it's ignored.

Usage

Run

Manually

  • Run migrations: alembic upgrade head
  • Run the app using an ASGI server such as Uvicorn.

systemd

The server runs on :::4194.

systemctl start rabbitmq-consumer-log-server.service

Web GUI

Once the server is started, access the web GUI on /rpc-requests.

SSL

Use a proxy that terminates SSL. E.g. HAProxy.

When using a reverse proxy, 127.0.0.1 is trusted by default. To override this, set the FORWARDED_ALLOW_IPS environment variable. For more information, see the Uvicorn documentation (look for --proxy-headers and --forwarded-allow-ips).

⚠️ Development

Developing the RabbitMQ consumer? Access the API documentation on /redoc (Redoc) and /docs (Swagger).

Developing the log server? After installing it, and running migrations, seed your database with example data:

python3 seed_example_data.py

You can run the seeder multiple times to fill up your database with more data.

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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file python3_cyberfusion_rabbitmq_consumer_log_server-1.0.1.tar.gz.

File metadata

File hashes

Hashes for python3_cyberfusion_rabbitmq_consumer_log_server-1.0.1.tar.gz
Algorithm Hash digest
SHA256 985b2d9e5cfdfdb301920d7fdd926102f44c903c3afb6c033eb4b70216c91a74
MD5 4af31b01eef4bd03a7f53a0981f54b13
BLAKE2b-256 94c90a20bddf5e049f8d9c9c9435e94772583471d1716dde0f8b716afe90ea7e

See more details on using hashes here.

File details

Details for the file python3_cyberfusion_rabbitmq_consumer_log_server-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python3_cyberfusion_rabbitmq_consumer_log_server-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28ac125b131f9fc312304c4ac0270be8c67d376f8b8d330a820a6164e05e78d2
MD5 d8283bb6a251cd050f75e5973fb55e20
BLAKE2b-256 e7515e28bc66daddb92d9b29518d58adb100f66b8d2f093cbcdd79d72f056e48

See more details on using hashes here.

Supported by

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