API Gateway monitoring-service - High-performance Rust API Gateway
903
The Monitoring Service is a background service that monitors Redis and pod health, publishing events to RabbitMQ for other services to consume.
docker run -d \
--name api-gateway-monitoring-service \
-e REDIS_URL=redis://redis:6379 \
-e RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/%2f \
roryfig/api-gateway-monitoring-service:latest
| Tag | Description |
|---|---|
latest | Latest stable release |
vX.Y.Z | Specific version (e.g., v1.0.0) |
vX.Y | Latest patch of minor version |
vX | Latest minor of major version |
Required:
| Variable | Default | Description |
|---|---|---|
REDIS_URL | redis://localhost:6379 | Redis connection URL |
RABBITMQ_URL | amqp://guest:guest@localhost:5672/%2f | RabbitMQ connection URL |
CHECK_INTERVAL_SECONDS | 30 | Health check interval |
HEALTHY_LATENCY_THRESHOLD_MS | 50.0 | Latency for healthy status |
DEGRADED_LATENCY_THRESHOLD_MS | 200.0 | Latency for degraded status |
MEMORY_DEGRADED_THRESHOLD_PERCENT | 80.0 | Memory % for degraded |
MEMORY_UNHEALTHY_THRESHOLD_PERCENT | 95.0 | Memory % for unhealthy |
INSTANCE_ID | auto | Unique instance identifier |
RUST_LOG | info | Log level |
version: '3.8'
services:
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
image: rabbitmq:3-management-alpine
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 5
monitoring-service:
image: roryfig/api-gateway-monitoring-service:latest
environment:
REDIS_URL: redis://redis:6379
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/%2f
CHECK_INTERVAL_SECONDS: "30"
depends_on:
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
restart: unless-stopped
The monitoring service publishes health events to RabbitMQ with the following structure:
{
"instance_id": "monitor-abc123",
"timestamp": "2024-01-15T10:30:00Z",
"redis": {
"status": "healthy",
"latency_ms": 2.5,
"memory_used_percent": 45.2
},
"pods": {
"control-plane": "healthy",
"data-plane": "healthy"
}
}
| Metric | Healthy | Degraded | Unhealthy |
|---|---|---|---|
| Redis Latency | < 50ms | 50-200ms | > 200ms |
| Redis Memory | < 80% | 80-95% | > 95% |
Content type
Helm
Digest
sha256:4b0170041…
Size
3.7 kB
Last updated
7 months ago
helm pull oci://registry-1.docker.io/roryfig/api-gateway-monitoring-service --version 0.0.0-main.9d0c63f6