roryfig/api-gateway-monitoring-service

By roryfig

Updated 7 months ago

API Gateway monitoring-service - High-performance Rust API Gateway

Helm
Image
0

903

roryfig/api-gateway-monitoring-service repository overview

API Gateway Monitoring Service

The Monitoring Service is a background service that monitors Redis and pod health, publishing events to RabbitMQ for other services to consume.

Quick Start

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

Image Tags

TagDescription
latestLatest stable release
vX.Y.ZSpecific version (e.g., v1.0.0)
vX.YLatest patch of minor version
vXLatest minor of major version

Dependencies

Required:

  • Redis (monitored for health and metrics)
  • RabbitMQ (publishes health events)

Environment Variables

VariableDefaultDescription
REDIS_URLredis://localhost:6379Redis connection URL
RABBITMQ_URLamqp://guest:guest@localhost:5672/%2fRabbitMQ connection URL
CHECK_INTERVAL_SECONDS30Health check interval
HEALTHY_LATENCY_THRESHOLD_MS50.0Latency for healthy status
DEGRADED_LATENCY_THRESHOLD_MS200.0Latency for degraded status
MEMORY_DEGRADED_THRESHOLD_PERCENT80.0Memory % for degraded
MEMORY_UNHEALTHY_THRESHOLD_PERCENT95.0Memory % for unhealthy
INSTANCE_IDautoUnique instance identifier
RUST_LOGinfoLog level

Docker Compose

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

Health Events

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"
  }
}

Status Thresholds

MetricHealthyDegradedUnhealthy
Redis Latency< 50ms50-200ms> 200ms
Redis Memory< 80%80-95%> 95%

Tag summary

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