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'
  • 相关阅读:
    04_Windows平台Spark开发环境构建
    Hadoop Streaming 使用及参数设置
    Kafka 及 PyKafka 的使用
    Database Subquery
    Miscellaneous
    Emacs
    算法归纳
    逆元求组合数
    Elasticsearch 原理
    Linux的内存分页管理【转】
  • 原文地址:https://www.cnblogs.com/37yan/p/14962616.html
Copyright © 2011-2022 走看看