Prometheus, Grafana and Blackbox monitoring services#486
Open
Rayverse-cloud wants to merge 22 commits intodockersamples:mainfrom
Open
Prometheus, Grafana and Blackbox monitoring services#486Rayverse-cloud wants to merge 22 commits intodockersamples:mainfrom
Rayverse-cloud wants to merge 22 commits intodockersamples:mainfrom
Conversation
feat: UI rebrand — vote page, result page, backend and worker
ci: update workflows to trigger on dev and push to scagroup6 GHCR
CI/CD modifications
remove reusable workflow
…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
Terraform for AWS production
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Monitoring Setup — Racheal Adeyemo
Added Prometheus, Grafana and Blackbox Exporter monitoring services
to the voting app docker-compose.yml
Services Added:
How to run:
docker compose up -d