使用Prometheus监控etcd

安装


docker pull prom/prometheus

配置文件


# my global config

global:

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

  evaluation_interval: 10s # By default, scrape targets every 15 seconds.

  # scrape_timeout is set to the global default (10s).


# Load and evaluate rules in this file every 'evaluation_interval' seconds.

rule_files:

  # - "first.rules"

  # - "second.rules"


# 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: 10s

    scrape_timeout: 10s


    # metrics_path defaults to '/metrics'

    # scheme defaults to 'http'.

    # 这里配置要监控的所有etcd节点

    target_groups:

      - targets: ['10.2.122.70:5001','10.2.122.71:5001','10.2.122.72:5001']

运行

注意prometheus的web界面使用9090端口


docker run -p 5002:9090 -v /home/codecraft/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prometheus

访问

http://10.2.122.70:5002

自动把集群的所有请求汇总了。

alertmanager

参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值