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

    ... 未完成,明天写

  • 相关阅读:
    codeforces#571Div2 D---Vus the Cossack and Numbers【贪心】
    洛谷P1050 循环【java大数】
    洛谷P1972 HH的项链【树状数组】
    uoj#67 新年的毒瘤【Tarjan】
    洛谷1265 公路修建【最小生成树】
    【超实用工具】三维场景绘制工具
    坐标地址批处理工具
    CAD转KML乱码处理
    地理编码逆编码教程
    最新!全球ALOS 12m地形数据介绍及下载
  • 原文地址:https://www.cnblogs.com/DevOpsTechLab/p/13855206.html
Copyright © 2011-2022 走看看