- Prometheus 已部署
- node_exporter 已部署
2.1 在 prometheus.yml 中配置 node_exporter 的metrics 端点
进入prometheus安装目录,打开配置文件
vim prometheus.yml
2.2 在配置文件增加job_name信息
scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. - job_name: 'prometheus' # metrics_path defaults to '/metrics' # scheme defaults to 'http'. static_configs: - targets: ['localhost:9090'] - job_name: 'name' metrics_path: /metrics static_configs: - targets : ['ip:9100']