zoukankan      html  css  js  c++  java
  • imooc 使用Prometheus实践基于Spring Boot监控告警体系 笔记

    https://www.imooc.com/coursescore/1231

    安装prom

    启动

     ./prometheus --config.file=prometheus.yml

     启动,并可以通过web动态更新配置

    ./prometheus --config.file=prometheus.yml --web.enable-lifecycle

    动态更新配置

    curl -X POST http://localhost:9090/-/reload

    访问:

    http://192.168.219.129:9090/graph

    和metrics页面

    http://192.168.219.129:9090/metrics

    cat prometheus.yml

    # my global config
    global:
      scrape_interval:     15s # 抓取间隔
      evaluation_interval: 15s # 计算间隔
      # 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']

    grafana安装:

    https://grafana.com/grafana/download

  • 相关阅读:
    判断元素的属性是否存在
    js 查找树节点 数组去重
    redis 基础知识
    jQuey知识点三 解析json数据
    jQuery知识点二 实现隔行变色
    mysql 基础操作一
    ruby 基础知识三 读写文件
    Active Record 数据迁移
    ruby 基础知识(二)
    rails 常用的知识点
  • 原文地址:https://www.cnblogs.com/alexhjl/p/13877978.html
Copyright © 2011-2022 走看看