diff --git a/monitoring_stack/docker-compose.yml b/monitoring_stack/docker-compose.yml new file mode 100644 index 0000000..f10a12b --- /dev/null +++ b/monitoring_stack/docker-compose.yml @@ -0,0 +1,40 @@ +version: '3.8' + +services: + node_exporter: + image: prom/node-exporter + container_name: node_exporter + ports: + - 9100:9100 + networks: + - my_network + + prometheus: + image: prom/prometheus + container_name: prometheus + command: + - --config.file=/etc/prometheus/prometheus.yml + ports: + - 9090:9090 + restart: unless-stopped + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml + networks: + - my_network + depends_on: + - node_exporter + + grafana: + image: grafana/grafana-oss + container_name: grafana + restart: unless-stopped + ports: + - 3000:3000 + volumes: + - grafana-storage:/var/lib/grafana +volumes: + grafana-storage: {} + +networks: + my_network: + driver: bridge diff --git a/monitoring_stack/prometheus.yml b/monitoring_stack/prometheus.yml new file mode 100644 index 0000000..ab0a4f2 --- /dev/null +++ b/monitoring_stack/prometheus.yml @@ -0,0 +1,18 @@ +global: + scrape_interval: 15s + scrape_timeout: 10s + evaluation_interval: 15s + +alerting: + alertmanagers: + - static_configs: + - targets: [] + +scrape_configs: + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] + + - job_name: 'node_exporter' + static_configs: + - targets: ['localhost:9100'] # weird error: in prometheus it shows you cannot scrap from it but if you try to access it, you get container ID(of node exporter) than IP or even localhost