Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 3.15 KB

README.md

File metadata and controls

69 lines (47 loc) · 3.15 KB

rabbitmq-loki-forwarder

A simple Python script / app for pushing internal RabbitMQ messages from queue to the Loki instance.

For more details look for Event Exchange Plugin.

Usage

Docker

Run the app in the docker container with the default setup:

docker run -d ghcr.io/trojanekkk/rabbitmq-loki-forwarder:1.1.0

For almost 100% you will want to configure the app to make it work within your environment. To modify the default behaviour use environment variables. The following are allowed:

  • FORWARDER_LOKI_HOST (defaults to localhost) - Hostname or IP address of the Loki server
  • FORWARDER_LOKI_PORT (defaults to 3100) - Port of the Loki server
  • FORWARDER_RABBITMQ_HOST (defaults to localhost) - Hostname or IP address of the RabbitMQ server
  • FORWARDER_RABBITMQ_PORT (defaults to 5672) - Port of the RabbitMQ server
  • FORWARDER_RABBITMQ_USERNAME (defaults to guest) - Username to authorize with the RabbitMQ server
  • FORWARDER_RABBITMQ_PASSWORD (defaults to guest) - Password to authorize with the RabbitMQ server
  • FORWARDER_RABBITMQ_QUEUE (defaults to event_queue) - Name of the Queue in the RabbitMQ server which is bound to the Event Exchange (check Event Exchange Plugin for more details)
  • FORWARDER_APPLICATION_NAME (defaults to rabbitmq-loki-forwarder) - Tag added to every message in the queue for filtering data in e.g. Grafana

For example:

docker run -d -e FORWARDER_LOKI_HOST=192.168.1.1 -e FORWARDER_LOKI_PORT=4321 ghcr.io/trojanekkk/rabbitmq-loki-forwarder:1.1.0

Kubernetes (kubectl)

Run the app in the kubernetes cluster with the default setup:

kubectl apply -f https://raw.githubusercontent.com/Trojanekkk/RabbitMQ-Loki-Forwarder/refs/heads/main/k8s/deployment.yaml
kubectl apply -f https://raw.githubusercontent.com/Trojanekkk/RabbitMQ-Loki-Forwarder/refs/heads/main/k8s/configmap.yaml

For almost 100% you will want to configure the app to make it work within your environment. To modify the default behaviour clone or copy k8s/configmap.yaml file to your local filesystem, and modify the values accordingly. For detailed description check-out Docker usage (above). Then apply the configmap to your kubernetes cluster.

kubectl apply -f https://raw.githubusercontent.com/Trojanekkk/RabbitMQ-Loki-Forwarder/refs/heads/main/k8s/deployment.yaml
kubectl apply -f path/to/configmap/configmap.yaml

Kubernetes (helm)

To install the app with Helm, clone the repository to your local filesystem. Go to the helm directory and generate Helm package:

helm package .

The command will produce rabbitmq-loki-forwarder-1.1.0.tgz file. Now, you can install it on the cluster:

helm install rabbitmq-loki-forwarder rabbitmq-loki-forwarder-1.1.0.tgz

It will install the app in the default namespace. Use standard Helm's switches to modify it accordingly.

For almost 100% you will want to configure the app to make it work within your environment. To modify the default behaviour modify helm/values.yaml file. For detailed description check-out Docker usage (above). Then install the app with Helm command:

helm install rabbitmq-loki-forwarder rabbitmq-loki-forwarder-1.1.0.tgz -f values.yaml