Grafana Prometheus的设置备忘录
安装Grafana
wget https://dl.grafana.com/oss/release/grafana-6.6.2-1.x86_64.rpm
yum install --allowerasing grafana-6.6.2-1.x86_64.rpm
touch /etc/grafana/grafana.ini
从 Prometheus 的安装到服务器本身指标的图形化显示进行简单操作确认。请参考:https://prometheus.io/docs/introduction/first_steps/
在本地获取node-exporter的指标,并通过Prometheus进行图形显示确认。
Grafana 对 Prometheus 的支持
https://prometheus.io/docs/visualization/grafana/
启动
/opt/node_exporter-1.0.0-rc.0.linux-amd64/node_exporter &
/opt/prometheus/prometheus-2.17.0-rc.0.linux-amd64/prometheus --config.file=prometheus.yml &
systemctl start grafana-server
请在浏览器中确认:
http://192.168.80.131:3000/
所有本地配置文件(prometheus.yml)
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
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:9100']
https://prometheus.io/docs/prometheus/latest/storage/
※似乎没有存储限制(可能阻碍月度评估目的的因素)。