Promethues使用记录

2020-05-29  本文已影响0人  调雨为酥

下载Promethues

官网下载地址:https://prometheus.io/download/
下载Linux版本:https://github.com/prometheus/prometheus/releases/download/v2.18.1/prometheus-2.18.1.linux-amd64.tar.gz

wget "https://github.com/prometheus/prometheus/releases/download/v2.18.1/prometheus-2.18.1.linux-amd64.tar.gz"

安装Promethues

官网提供的安装方法:https://prometheus.io/docs/prometheus/latest/getting_started/

tar xvfz prometheus-*.tar.gz
cd prometheus-*

修改配置文件prometheus.yml

global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
    monitor: 'codelab-monitor'

# 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'

    # Override the global default and scrape targets from this job every 5 seconds.
    scrape_interval: 5s

    static_configs:
      - targets: ['localhost:9090']

启动Promethues

./prometheus --config.file=prometheus.yml

启动之后打开网址http://localhost:9090/

探索更多

https://blog.csdn.net/u012129558/article/details/92087707
中文文档:https://prometheus.fuckcloudnative.io/

上一篇下一篇

猜你喜欢

热点阅读