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
相关推荐
Jinkxs14 小时前
Prometheus - 监控微服务:Spring Boot 应用指标暴露与监控
spring boot·微服务·prometheus
云烟成雨TD20 小时前
Spring AI 1.x 系列【50】可观测性:接入 Prometheus + Grafana
人工智能·spring·prometheus
YDS8291 天前
DeepSeek RAG&MCP + Agent智能体项目 —— 集成ELK日志管理系统和Prometheus监控系统
java·elk·ai·springboot·agent·prometheus·deepseek
暮云星影2 天前
个人总结 搭建Docker监控
docker·容器·grafana·prometheus
成为你的宁宁4 天前
【基于 Prometheus Operator 监控 K8s控制器、调度器、代理组件】
kubernetes·prometheus
溜达的大象5 天前
服务器挂了等用户报障?我用Prometheus搭了一套监控告警,服务器出状况第一时间通知我
服务器·php·prometheus
tudoSearcher5 天前
日志、指标、链路追踪:可观测性三支柱深度解析
运维·服务器·网络·prometheus
IT策士5 天前
第 41 篇 k8s之监控:Metrics Server 与 Prometheus 快速上手
容器·kubernetes·prometheus
Junsir大斗师5 天前
rocky9.7搭建grafana+loki+prometheus+alloy+node_exporter运维监控平台
linux·运维·grafana·prometheus