Node.js consumer for RabbitMQ that processes Rust+ smart alarm events generated by the Rust game and logs them in a structured format.
{
"active": false,
"reachable": true,
"everyone": true,
"name": "YOUR BASE IS UNDER ATTACK",
"message": "YOUR BASE IS UNDER ATTACK",
"lastTrigger": 1567870268,
"command": "317829368",
"id": "357925331",
"image": "smart_alarm.png",
"location": "T13",
"server": "Rusty Moose |EU Main|",
"messageId": "1453794030969426105"
}
The application includes built-in Prometheus metrics for monitoring alarm events. Metrics are exposed on a dedicated HTTP endpoint when enabled.
Enable metrics by setting environment variables:
METRICS_ENABLED=true
METRICS_PORT=9100
Metrics endpoint: http://localhost:9100/metrics
rust_alarms_totalCounter of the total number of alarms received since the application started.
this.alarmsTotal = new Counter({
name: 'rust_alarms_total',
help: 'Total number of alarms received',
})
Type: Counter
Labels: None
rust_alarms_by_serverAlarm counter grouped by server. Allows you to track which servers generate the most alarms.
this.alarmsByServer = new Counter({
name: 'rust_alarms_by_server',
help: 'Server alarms',
labelNames: ['server'],
})
Type: Counter
Labels: server
rust_alarms_by_dayAlarm counter grouped by day. Useful for analyzing temporary trends.
this.alarmsByDay = new Counter({
name: 'rust_alarms_by_day',
help: 'Alarms per day',
labelNames: ['date'],
})
Type: Counter
Labels: date
Add this job to your prometheus.yml:
scrape_configs:
- job_name: 'rpp-consumer-node'
static_configs:
- targets: ['rpp-consumer-node:9100']
docker pull negrii/rpp-consumer-node:latest
docker pull ghcr.io/negri234279/rpp-consumer-node:latest
Also available by version:
v1.0.0
v1.0.1
v1.1.0
| Variable | Description | Default |
|---|---|---|
| RABBITMQ_HOST | RabbitMQ host | - |
| RABBITMQ_PORT | RabbitMQ port | - |
| RABBITMQ_USER | RabbitMQ username | - |
| RABBITMQ_PASSWORD | RabbitMQ password | - |
| METRICS_ENABLED | Enable Prometheus metrics (true/false) | false |
| METRICS_PORT | Port for Prometheus metrics endpoint | 9100 |
| TZ | Timezone for logs (IANA timezone databaseā ) | Europe/Madrid |
| LOCALE | Unicode BCP 47 locale identifier for formatting | es-ES |
The LOCALE variable uses the Unicode BCP 47 locale identifier standard (Unicode TR35ā ). This determines how dates, times, and numbers are formatted in logs.
Common values:
es-ES - Spanish (Spain)en-US - English (United States)en-GB - English (United Kingdom)fr-FR - French (France)de-DE - German (Germany)pt-BR - Portuguese (Brazil)Format example with es-ES:
[31/12/2025 23:45:30] [INFO] Smart alarm processed for server: Rustopia
Format example with en-US:
[12/31/2025 11:45:30] [INFO] Smart alarm processed for server: Rustopia
docker run -d \
--name rpp-consumer-node \
--env-file .env \
--restart unless-stopped \
-v rpp-consumer-node-logs:/app/logs \
negrii/rpp-consumer-node:latest
docker-compose.ymlservices:
rpp-consumer-node:
image: negrii/rpp-consumer-node:latest
container_name: rpp-consumer-node
ports:
- '9100:9100' # Expose to the host the prometheus metrics
env_file:
- .env
restart: unless-stopped
volumes:
- rpp-consumer-node-logs:/app/logs
# If enable the prometheus metrics
rpp_prometheus:
container_name: rpp_prometheus
image: prom/prometheus:latest
restart: unless-stopped
ports:
- '9090:9090'
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- rpp_prometheus_data:/prometheus
volumes:
rpp-consumer-node-logs:
docker compose up -d
View logs:
docker logs -f rpp-consumer-node
docker rm -f rpp-consumer-node
docker volume rm rpp-consumer-node-logs
ā ļø This will remove all persisted state.
docker compose -f 'docker-compose.dev.yml' up -d --build
This project uses GitHub Actions for:
Each push to main generates a new version if the commits require it.
Negrii š https://github.com/Negri234279ā
MIT License
Pull requests and suggestions are welcome š
If you find this project useful, leave a ā on GitHub
Content type
Image
Digest
sha256:03f11ec17ā¦
Size
80.6 MB
Last updated
8 months ago
docker pull negrii/rpp-consumer-node