Skip to content

Commit

Permalink
Merge pull request #37 from mohamad-liyaghi/monitoring
Browse files Browse the repository at this point in the history
Monitoring
  • Loading branch information
mohamad-liyaghi authored Jul 28, 2024
2 parents f1ea232 + 1034e17 commit 4a64b94
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,44 @@ services:
rabbitmq:
condition: service_healthy

prometheus:
image: prom/prometheus
container_name: academy-master-prometheus
volumes:
- ./prometheus/config.yaml:/etc/prometheus/prometheus.yml
- invest-club_prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- "9090:9090"
depends_on:
- backend
networks:
- main

node_exporter:
image: quay.io/prometheus/node-exporter:latest
container_name: academy-master-node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- invest-club_node_exporter_data:/host
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
expose:
- 9100
networks:
- main


# frontend:
# extends:
Expand Down
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,41 @@ services:
rabbitmq:
condition: service_healthy

prometheus:
image: prom/prometheus
container_name: academy-master-prometheus
volumes:
- ./prometheus/config.yaml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- "9090:9090"
depends_on:
- backend
networks:
- main

node_exporter:
image: quay.io/prometheus/node-exporter:latest
container_name: academy-master-node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
expose:
- 9100
networks:
- main

# frontend:
# extends:
Expand Down
12 changes: 12 additions & 0 deletions prometheus/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
global:
scrape_interval: 1m

scrape_configs:
- job_name: 'prometheus'
scrape_interval: 1m
static_configs:
- targets: ['prometheus:9090']

- job_name: 'node'
static_configs:
- targets: [ 'node_exporter:9100' ]

0 comments on commit 4a64b94

Please sign in to comment.