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

    ... 未完成,明天写

  • 相关阅读:
    Android-adb相关
    我想和iOS大牛们交流的问题
    iOS应用 bug定位
    iOS 中Block的基础用法
    iOS9 耗电量惊人
    三人小团队git分支协作试水
    今天开通了博客
    解决XCode安装插件后插件不能使用的问题(转载)
    (转载)iOS- 指压即达,如何集成iOS9里的3D Touch
    人魔七七
  • 原文地址:https://www.cnblogs.com/DevOpsTechLab/p/13855206.html
Copyright © 2020-2023  润新知