Skip to content

Prometheus, Grafana and Blackbox monitoring services#486

Open
Rayverse-cloud wants to merge 22 commits intodockersamples:mainfrom
SCAGroup6:racheal-monitoring
Open

Prometheus, Grafana and Blackbox monitoring services#486
Rayverse-cloud wants to merge 22 commits intodockersamples:mainfrom
SCAGroup6:racheal-monitoring

Conversation

@Rayverse-cloud
Copy link
Copy Markdown

Monitoring Setup — Racheal Adeyemo

Added Prometheus, Grafana and Blackbox Exporter monitoring services
to the voting app docker-compose.yml

Services Added:

  • Prometheus (port 9090) — metrics collection
  • Grafana (port 3000) — metrics visualization
  • Blackbox Exporter (port 9115) — endpoint monitoring for vote and result apps

How to run:

docker compose up -d

Udoka Ineh and others added 22 commits April 19, 2026 17:25
feat: UI rebrand — vote page, result page, backend and worker
ci: update workflows to trigger on dev and push to scagroup6 GHCR
…into dev

services:
  vote: # frontend voting service
    build:
      context: ./vote
      target: dev
    restart: always
    depends_on:
      redis:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost"]
      interval: 15s
      timeout: 5s
      retries: 3
      start_period: 10s
    volumes:
     - ./vote:/usr/local/app
    ports:
      - "8080:80"
    networks:
      - front-tier
      - back-tier
    environment:
      - ENV=development

  result:
    build: ./result # backend voting service
    # use nodemon rather than node for local dev
    restart: always
    entrypoint: nodemon --inspect=0.0.0.0 server.js
    depends_on:
      db:
        condition: service_healthy
    volumes:
      - ./result:/usr/local/app
    ports:
      - "8081:80"
      - "127.0.0.1:9229:9229"
    networks:
      - front-tier
      - back-tier
     environment:
    - NODE_ENV=development

  worker: # Background worker processing votes
    build:
      context: ./worker
    restart: always
    depends_on:
      redis:
        condition: service_healthy
      db:
        condition: service_healthy
    networks:
      - back-tier

  redis:
    image: redis:alpine
    restart: always
    volumes:
      - "./healthchecks:/healthchecks"
    healthcheck:
      test: /healthchecks/redis.sh
      interval: "5s"
    networks:
      - back-tier

  db:
    image: postgres:15-alpine
    restart: always
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - "db-data:/var/lib/postgresql/data"
      - "./healthchecks:/healthchecks"
    healthcheck:
      test: /healthchecks/postgres.sh
      interval: "5s"
    networks:
      - back-tier

  # this service runs once to seed the database with votes
  # it won't run unless you specify the "seed" profile
  # docker compose --profile seed up -d
  seed:
    build: ./seed-data
    profiles: ["seed"]
    depends_on:
      vote:
        condition: service_healthy
    networks:
      - front-tier
    restart: "no"

volumes: # Ensures database persistence
  db-data:

networks:
  front-tier:
  back-tier:# the commit.
Update docker compose file with restart policy
- VPC with public/private subnets, IGW, NAT gateway
- Security groups for ALB, ECS tasks, RDS, ElastiCache
- Application Load Balancer with listeners for vote (80) and result (8080)
- ECS Fargate cluster with task definitions and services for vote, result, worker
- RDS Postgres replacing local db container
- ElastiCache Redis replacing local redis container
- IAM roles for ECS task execution and task permissions
- CloudWatch log groups for container logging
- Updated app source to read connection hostnames from env vars
- CPU utilization alarms for vote and result ECS services
- Database connection count alarm for RDS
- CPU utilization alarm for ElastiCache Redis
- All alarms configured with 2-minute evaluation period and appropriate thresholds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants