Grafana画出prometheus的图
公司要做阿里的小程序接入,需要通过测试,测试呢需要提供硬盘的监控报告,比如 iops 。 同事从网上找了一下,iops 监控原文如下:监控磁盘的 iops ,利用 linux 的 /proc/diskstats 的第四个字段和第八字段可监控读和写的 iops,第四个记录是记录所有读的次数,第八个字段是记录所有写的次数。通过 zabbix 上的差速率即可监控磁盘的 iops。 文章链接:https://cloud.tencent.com/developer/article/1519113?ivk_sa=1024320u 仔细研究了一下上面的文章,看了它提供了两张监控图,分析一下: 第一张图: 有两个指标,绿色的是硬盘每秒的 io 读次数,红色的是硬盘每秒的 io 写次数。 第二张图: 同样两个指标,绿色的是硬盘每秒的 io 读 Bytes,红色的是硬盘每秒的 io 写 Bytes。 知道了指标具体的含义,这样就好办了。 我们用的是 prometheus 和 node_exporter 首先去看看 node_exporter 暴露的指标,搜一搜 node_disk,会看到如下4个指标: # HELP node_disk_reads_completed_total The total number of reads completed successfully. # TYPE node_disk_reads_completed_total counter node_disk_reads_completed_total{device="sda"} 4.9530358e+07 # HELP node_disk_writes_completed_total The total number of writes completed successfully. # TYPE node_disk_writes_completed_total counter node_disk_writes_completed_total{device="sda"} 1.4449267304e+10 # HELP node_disk_read_bytes_total The total number of bytes read successfully. # TYPE node_disk_read_bytes_total counter node_disk_read_bytes_total{device="sda"} 6.4101677568e+11 # HELP node_disk_written_bytes_total The total number of bytes written successfully. # TYPE node_disk_written_bytes_total counter node_disk_written_bytes_total{device="sda"} 1.15483858333184e+14 可以看出是上面 4 个指标,这四个指标都是 counter 计数器类型的,都是只增不减的。 ...