无经验快速上手 prometheus

10 篇文章 2 订阅

prometheus 功能强大的监控软件

  1. prometheus 能够监控各种各样的东西,例如虚拟机,docker容器,kubernates pods,API接口等等
  2. 能够满足从软件到硬件的全序列监控
  3. 开源生态丰富,各种插件,各种模板,只要你会百度,不需要掌握原理和框架,就能快速上手
  4. 搭配 grafana ,不仅采集及时,监控出来的页面也非常好看,对我们不懂前端和UI的人来说,简直是超级强大

如何使用

  1. 安装 prometheus
    • 源码安装
    • docker 安装
  2. 安装 node-exporter,负责收集主机数据(CPU,内存),prometheus 定时拉取
    • 解压后可直接运行
  3. 安装grafana
    • docker 安装
  4. 参数那么多,名字那么复杂,那么该如何画图呢,很简单
    • 配置 grafana 的数据源,其实就是把 prometheus 的网站粘贴上去
    • 选择好看的模板 https://grafana.com/grafana/dashboards
    • 强烈推荐node-exporter的模板,https://grafana.com/grafana/dashboards/8919
    • 点击 +, 点击 import dashboard, 在 Import via grafana.com 中粘贴模板的网址,点击 Load,选择数据源,就好了
  5. 导入 grafana 模板过程截图
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
  6. 大功告成

更多收集器

  1. blackbox_exporter
  2. CAdvisor
  3. 各种数据库的exporter, 例如mysql,redis,influxdb等等
  4. 官网合集https://prometheus.io/docs/instrumenting/exporters/

更多grafana模板

  1. docker 监控 https://grafana.com/grafana/dashboards/10566
  2. blackbox 监控 https://grafana.com/grafana/dashboards/9965
  3. 官网合集 https://grafana.com/grafana/dashboards

各种资源下载方式

  1. prometheus https://github.com/prometheus/prometheus
  2. cAdvisor https://www.cnblogs.com/xiao987334176/p/12340743.html
  3. blockbox https://blog.csdn.net/qq_25934401/article/details/84325356
  4. node-exporter https://www.cnblogs.com/xiangsikai/p/11289157.html

prometheus 查询语句 (PromQL)

  1. 教程 https://yunlzheng.gitbook.io/prometheus-book/part-ii-prometheus-jin-jie/grafana/templating

更多关于 prometheus 细节

  1. https://yunlzheng.gitbook.io/prometheus-book/parti-prometheus-ji-chu/quickstart
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值