zoukankan      html  css  js  c++  java
  • prometheus告警配置注意事项

    global:
      scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
      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: ['100.101.201.131:9093']


    rule_files:
      - 'rules.yml'
    # - "second_rules.yml"


    # Here it's Prometheus itself.
    scrape_configs:

     - job_name: 'beta'
        scrape_timeout: 14s #超时时间必须少于即间隔scrape_interval,这里是14s,小于15s
        relabel_configs:
         regex: "(.*),(.+),(.*)" #正则匹配
         replacement: $2  #第二个
         action: replace #动作为替换
         target_label: "nodename" #目标的key为这个
        consul_sd_configs:
        - server: '127.0.0.1:8501'    
    global:
      resolve_timeout: 2h
     
    route:
      group_by: ['alertname']
      group_wait: 5s
      group_interval: 10s
      repeat_interval: 1h  #告警发送到webhook的间隔时间
      receiver: 'webhook'
     
    receivers:
    - name: 'webhook'
      webhook_configs:
      - url: 'http://127.0.0.1:5001/send'
        send_resolved: true
  • 相关阅读:
    Can you feel my word?
    木语录
    走在风雨中
    我看平淡生活……
    Can you feel my word?
    我看平淡生活……
    留言本
    Python(七)之匿名函数lambda
    python之常用模块logging
    python(六)之面向对象
  • 原文地址:https://www.cnblogs.com/kevincaptain/p/10531995.html
Copyright © 2011-2022 走看看