美文网首页
服务器端 性能数据监控

服务器端 性能数据监控

作者: bonnie_xing | 来源:发表于2020-09-18 11:52 被阅读0次

    说在前面:接着上一条 locust实现压力测试 测试报告 性能监控平台
    在实现了TPS和RT监控之后,现在需要对系统的数据进行监控。
    一下介绍将再上一条基础上。继续使用Prometheus、Grafana进行数据收集和展示

    效果图

    先来一个搭建好之后的效果图


    image.png

    实现方式

    一、修改Prometheus的配置文件

    增加 node-exporter 的数据收集
    该文件存储在了对应的性能测试脚本下:
    /home/ops/bonnie/load_test_0806/prometheus.yml

    global:
      scrape_interval:     10s
      evaluation_interval: 10s
    
    scrape_configs:
      - job_name: prometheus
        static_configs:
          - targets: ['host.docker.internal:9090']
            labels:
              instance: prometheus
    
      - job_name: locust
    
        metrics_path: '/export/prometheus'
        static_configs:
          - targets: ['172.28.249.182:8089']
            labels:
              instance: locust
    
      - job_name: 'server'
        static_configs:
          - targets: ['172.17.0.1:9100']
            labels:
              instance: server
    
    

    二、运行启动 node-exporter,进行数据上报

    docker run -itd --name=node-exporter   -p 9100:9100   -v "/proc:/host/proc:ro"   -v "/sys:/host/sys:ro"   -v "/:/rootfs:ro"   --restart=always   prom/node-exporter
    

    三、重启Prometheus

    找到正在运行的Prometheus的docker
    重新启动

    docker ps -a
    docker restart d945c8a3773e
    
    image.png

    四、配置Grafana模板

    直接选择现有的模板即可


    image.png

    参考链接

    https://blog.csdn.net/catoop/article/details/103992643
    https://segmentfault.com/a/1190000022547814

    相关文章

      网友评论

          本文标题:服务器端 性能数据监控

          本文链接:https://www.haomeiwen.com/subject/wgzdyktx.html