zoukankan      html  css  js  c++  java
  • 【Prometheus专题】3. Prometheus监控组件的配置

    prometheus监控组件的配置的自由度并不是很高,也有一定得规范,总的还说还是中规中矩

    Prometheus

    首先我们来看一下默认的配置

    # my global config
    global:
      scrape_interval:     15s     # 多久 收集 一次数据
      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:9090']
    

    这里主要说明下alerting和prometheus监控自身部分的配置,因为我们修改了服务的URL,所以默认的配置是无法发送告警的

    alerting:
      alertmanagers:
      - static_configs:
        - targets: ['localhost:9093']
        path_prefix: '/alertmanager'
        timeout: 30s
    
    - job_name: 'prometheus'
        scrape_interval: 60s
        metrics_path: '/prometheus/metrics'
        static_configs:
        - targets: ['localhost:9090']
    

    ... 未完成,明天写

  • 相关阅读:
    CSS3学习-用CSS制作立体导航栏
    JS学习-事件响应小结-简单的计算器
    BOM学习-javascript计时器小结
    php 正则表达式
    zTree插件的应用
    css样式篇
    iso移动端input的bug解决(vue)
    html2canvas文字重叠(手机端)
    react中使用antd遇到的问题
    react开发初始配置和一些问题
  • 原文地址:https://www.cnblogs.com/DevOpsTechLab/p/13855206.html
Copyright © 2011-2022 走看看