Grafana集成prometheus(3.Grafana添加promethus数据)

添加数据库

选择Connections -> Datasources,点击Add New data source,填写Promitheus Server Url,点击 save & test完成配置

添加DashBorad

  • 选择prometheus数据库
  • 选择code
  • 填入对应的查询公式(监控公式参考Prometheus监控公式)
  • 修改面板名称Title
  • 点击save

常见公式记录

百度可以获取常见用途的公式,mark备用。

内存使用率

shell 复制代码
(1- (node_memory_Buffers_bytes + node_memory_Cached_bytes + node_memory_MemFree_bytes) / node_memory_MemTotal_bytes) * 100

读IO

shell 复制代码
sum by (instance) (rate(node_disk_reads_completed_total[1m]))

写IO

shell 复制代码
sum by (instance) (rate(node_disk_writes_completed_total[1m]))

总读写IO

shell 复制代码
rate(node_disk_reads_completed_total[5m]) + rate(node_disk_writes_completed_total[5m])

磁盘监控

shell 复制代码
(1 - node_filesystem_avail_bytes{fstype=~"ext4|xfs"} / node_filesystem_size_bytes{fstype=~"ext4|xfs"}) * 100

可用内存

shell 复制代码
node_memory_Buffers_bytes + node_memory_Cached_bytes + node_memory_MemFree_bytes
相关推荐
tianyuanwo3 天前
Prometheus 服务部署指南:从架构原理到生产级落地
架构·prometheus
看浪的路人6 天前
第8讲:记忆系统的监控与运维——Prometheus 指标、Grafana 面板与告警体系
运维·grafana·prometheus
爬也要爬着前进7 天前
Prometheus通过Nginx-vts-exporter模块监控nginx服务
运维·nginx·prometheus
Crayon Lin7 天前
Prometheus
prometheus
学编程的小程9 天前
服务器日志太分散不好查?我用Promtail+Loki+Grafana把采集、查询和分析串起来了
服务器·python·grafana
川石课堂软件测试9 天前
JMeter异步接口测试实战
数据库·python·jmeter·mysql·kubernetes·测试用例·prometheus
lbb 小魔仙13 天前
Redis运行状态总靠手动查?我用redis_exporter+Prometheus把指标、告警和远程抓取全接起来了
redis·bootstrap·prometheus
程序员-Benothing13 天前
Linux系统监控工具全家桶:sar、dstat、glances、Prometheus
linux·运维·prometheus
花月C13 天前
Agent可观测性篇:Grafana
postgresql·grafana
wzq11_66613 天前
Prometheus监控——云原生与非云原生监控
云原生·prometheus