Skip to content

Commit

Permalink
feat: Add node-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirhBrt committed Feb 15, 2024
1 parent 3524d7a commit 14d3fa5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions broker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ FROM python:3.10-slim

WORKDIR /app

RUN wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
RUN tar xvf node_exporter-1.3.1.linux-amd64.tar.gz
RUN cd node_exporter-1.3.1.linux-amd64
RUN ./node-exporter

COPY requirements.txt requirements.txt

RUN pip install -r requirements.txt
Expand Down
14 changes: 4 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
- PORT=8082
ports:
- 8082:8082
- 9103:9100
depends_on:
- zookeeper
env_file:
Expand All @@ -20,6 +21,7 @@ services:
context: zookeeper
ports:
- 2181:2181
- 9102:9100
env_file:
- .env

Expand All @@ -37,16 +39,6 @@ services:
env_file:
- .env

node-exporter:
container_name: node-exporter
image: prom/node-exporter
ports:
- 9100:9100
depends_on:
- gateway
env_file:
- .env

grafana:
container_name: grafana
image: grafana/grafana
Expand All @@ -64,6 +56,7 @@ services:
image: minikafka:broker
ports:
- 8001:8001
- 9100:9100
env_file:
- .env
environment:
Expand All @@ -77,6 +70,7 @@ services:
image: minikafka:broker
ports:
- 8002:8002
- 9101:9100
env_file:
- .env
environment:
Expand Down
5 changes: 5 additions & 0 deletions gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ FROM python:3.10-slim

WORKDIR /app

RUN wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
RUN tar xvf node_exporter-1.3.1.linux-amd64.tar.gz
RUN cd node_exporter-1.3.1.linux-amd64
RUN ./node-exporter

COPY requirements.txt requirements.txt

RUN pip install -r requirements.txt
Expand Down
14 changes: 5 additions & 9 deletions prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ alerting:
timeout: 10s
api_version: v1
scrape_configs:
- job_name: node
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
scheme: http
static_configs:
- targets:
- node-exporter:9100
- job_name: zookeeper
honor_timestamps: true
scrape_interval: 15s
Expand All @@ -26,6 +18,7 @@ scrape_configs:
static_configs:
- targets:
- zookeeper:8000
- zookeeper:9100
- job_name: gateway
honor_timestamps: true
scrape_interval: 15s
Expand All @@ -34,6 +27,7 @@ scrape_configs:
static_configs:
- targets:
- gateway:8000
- gateway:9100
- job_name: broker-1
honor_timestamps: true
scrape_interval: 15s
Expand All @@ -42,11 +36,13 @@ scrape_configs:
static_configs:
- targets:
- broker-1:8000
- broker-1:9100
- job_name: broker-2
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
scheme: http
static_configs:
- targets:
- broker-2:8000
- broker-2:8000
- broker-2:9100
5 changes: 5 additions & 0 deletions zookeeper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ FROM python:3.10-slim

WORKDIR /app

RUN wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
RUN tar xvf node_exporter-1.3.1.linux-amd64.tar.gz
RUN cd node_exporter-1.3.1.linux-amd64
RUN ./node-exporter

COPY requirements.txt requirements.txt

RUN pip install -r requirements.txt
Expand Down

0 comments on commit 14d3fa5

Please sign in to comment.