prometheus学习(三)配置文件解读

master监控主机上的prometheus.yml

# my global config
global:  # global模块是全局配置信息,它定义的内容会被 scrape_configs模块中的每一个单独Job单独覆盖
  scrape_interval: 15s # 抓取 target的时间间隔 设置为15秒,默认值为1分钟,经验值为10-60秒
  evaluation_interval: 15s # Prometheus计算每一条规则配置的时间间隔,设置为15秒
  # scrape_timeout is set to the global default (10s).
  scrape——timeout: *s # 抓取target的超时时间, 默认为10s
  external_labels # 与外部系统通信时添加到任意时间序列或告警所用的外部标签
 
#告警模块:Prometheus server  发送请求给Altermanager之前也会触发一次relabel操作,
#alert子模块下 也可以配置alert_relabel_configs
# Alertmanager configuration 
alerting:
  alertmanagers:
    - static_configs: # 静态配置Alert manager的地址,也可以依赖服务发现动态识别
        - targets:       # 可以配置多个IP地址
          # - alertmanager:9093

# 加载规则一次,并定期根据全局的“evaluation_interval”计算它们。
# Prometheus 自定义rule主要分为 recording rule 和 altering rule
# 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 名字很重要。Prometheus会及那个该名称作为Label 追加到每条时许中
  - job_name: "prometheus"
    # metrics_path 默认值是 /metrics
    # metrics_path defaults to '/metrics'
    # scheme 默认是http
    # scheme defaults to 'http'.

    static_configs:  # 静态方式
      - targets: ["localhost:9090"]

  - job_name: "node01"
    static_configs:
      - targets: ["192.168.131.130:9100"]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值