zoukankan      html  css  js  c++  java
  • Prometheus 配置解析

    配置文件例子

    global:
      scrape_interval:     15s
      evaluation_interval: 15s
    
    alerting:
      alertmanagers:
      - static_configs:
        - targets:
          - localhost:9093
    
    rule_files:
    - "rules.yml"
    
    scrape_configs:
      - job_name: 'prometheus'
        static_configs:
        - targets: ['localhost:9090']
      - job_name: 'node_exporter'
        consul_sd_configs:
        - server: 192.168.10.17:8500
          tags:
          - node_exporter

    rules.yml

    groups:
    - name: node-alert.rules
      rules:
      - alert: NodeNetworkReceiveTooHigh
        expr: irate(node_network_receive_bytes_total{device="eth0"}[2m]) > 1000
        for: 5m
        labels:
          severity: warning
        annotations:
          description: "{{ $labels.device }}当前速率 {{ $value  }} bytes"
          summary: "网络下载速度过快"
    - name: node.rules
      rules:
      - record: node_network_receive_bytes_total:irate
        expr: irate(node_network_receive_bytes_total{device="eth0"}[2m])

    联邦配置

    scrape_configs:
      - job_name: 'federate'
        scrape_interval: 15s
    
        honor_labels: true
        metrics_path: '/federate'
    
        params:
          'match[]':
            - '{job="prometheus"}'
            - '{__name__=~"job:.*"}'
    
        static_configs:
          - targets:
            - 'source-prometheus-1:9090'
            - 'source-prometheus-2:9090'
            - 'source-prometheus-3:9090'
  • 相关阅读:
    hdoj 1872 稳定排序
    nyoj 60 谁获得了最高奖学金
    hdoj 2066 一个人的旅行
    nyoj 8 一种排序
    bzoj1798 1
    bzoj4031
    SPOJ-HIGH
    学习笔记::矩阵树定理
    学习笔记::树上莫队
    Strip
  • 原文地址:https://www.cnblogs.com/37yan/p/14962616.html
Copyright © 2011-2022 走看看