- install things needed
brew install node_exporter
deploy dashboard in docker-compose ...
- configuration on dashboard:
prometheus:
image: prom/prometheus:v2.1.0
user: root
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
- ./data/prometheus:/prometheus:rw
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--storage.tsdb.retention=15d'
ports:
- 9090:9090
networks:
- nebula-net
extra_hosts:
- "host.docker.internal:host-gateway" # this is needed
global:
scrape_interval: 5s
evaluation_interval: 5s
scrape_configs:
- job_name: 'node-exporter'
static_configs:
- targets: [
'host.docker.internal:9100' # your node-exporter metrics endpoints
]
- job_name: 'nebula-stats-exporter'
static_configs:
- targets: [
'nebula-stats-exporter:9200', # nebula-stats-exporter metrics endpoints
]
ensure dashboard and prometheus were restarted with
docker-compose stop
thendocker-compose up -d
- ensure no port occupying port 9100, and start node exporter
brew services start node_exporter
brew services restart node_exporter
# you could verify its status with
/opt/homebrew/Cellar/node_exporter/1.5.0/bin/node_exporter_brew_services
if 9100 is not avaliable, it will complain this, then ensure it's open and do the restart
...
ts=2022-12-01T10:17:18.355Z caller=node_exporter.go:201 level=error err="listen tcp :9100: bind: address already in use"
- verify that promethuse can reach the exporter:
# enter the netshoot container attached same network with prometheus to ensure you can curl exporter
docker run -it --net container:dashboard-prometheus-1 nicolaka/netshoot
# then, let's curl it
curl host.docker.internal:9100/metrics
If it's ok, we could move on
- check from browser