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でのグラフ表示確認
https://prometheus.io/docs/guides/node-exporter/

GRAFANA SUPPORT FOR 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/
※ストレージの制約(一か月の月次評価目的の阻害要因)はなさそう。