This is a service you install on your end-points that make CPU/Memory/Etc. metrics available to Prometheus.
On each device you want to monitor, install the node exporter with this command.
sudo apt install prometheus-node-exporter
Do a quick test to make sure it’s responding to scrapes.
Back on your Prometheus server, add these new nodes as a job in the
prometheus.yaml file. Feel free to drop the initial job where Prometheus was scraping itself.
global: scrape_interval: 15s scrape_configs: - job_name: 'servers' static_configs: - targets: - some.server:9100 - some.other.server:9100 - and.so.on:9100
sudo systemctl reload prometheus.service
You can check the status of your new targets at:
A lot of data is collected by default. On some low power systems you may want less. For just the basics, customize the the config to disable the defaults and only enable specific collectors.
In the case below we are reduce collection to just CPU, Memory, and Hardware metrics. When scraping a Pi 3B, this reduces the Scrape Duration from 500 to 50ms.
sudo sed -i 's/^ARGS.*/ARGS="--collector.disable-defaults --collector.hwmon --collector.cpu --collector.meminfo"/' /etc/default/prometheus-node-exporter sudo systemctl restart prometheus-node-exporter
The available collectors are listed on the page:
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.