参考: https://blog.csdn.net/yjph83/article/details/84909319

https://www.gitbook.com/book/songjiayang/prometheus/details (Prometheus 实战)

https://github.com/1046102779/prometheus (Prometheus 非官方中文手册)

http://www.bubuko.com/infodetail-2004088.html (基于prometheus监控k8s集群)

http://www.cnblogs.com/sfnz/p/6566951.html (安装prometheus+grafana监控mysql redis kubernetes等,非docker安装)

https://github.com/kayrus/prometheus-kubernetes (prometheus-kubernetes)

https://github.com/prometheus/node_exporter (prometheus/node_exporter)

http://dockone.io/article/2579 ( Prometheus在Kubernetes下的监控实践)

https://github.com/prometheus/prometheus/releases (prometheus 下载列表)

https://github.com/prometheus/node_exporter/releases/ (node_exporter下载列表)

前提概念:

1.时间序列是指将同一统计指标的数值按其发生的时间先后顺序排列而成的数列

2.

=:选择正好相等的字符串标签

!=:选择不相等的字符串标签

=~:选择匹配正则表达式的标签(或子标签)

!~:选择不匹配正则表达式的标签(或子标签)

3.

s:seconds

m:minutes

h:hours

d:days

w:weeks

y:years

注: [5m]指过去的5分钟内

4.操作符

bool

and

or

unless

on

without : without(label)在结果中移除括号内的标签和值

by : by(label)在结果中只保留括号内的标签和值

1.CPU空闲率

sum(irate(node_cpu{mode="idle", instance="134node"}[1m])) * 100 / count_scalar(node_cpu{mode="user", instance="134node"})

注释:

## instance:指的是label,具体根据实际配置,也可用正则匹配

## mode :      指cpu模式,node-exporter已经抓取出来,可以在node-exporter部署ip:9100这个网址上查看

例如:http://172.17.123.134:9100/metrics

## sum()函数: 指将括号内的指标值求和

## irate()函数: 指计算范围向量中时间序列的每秒钟的瞬时(per-second)速度(calculates the

per-second instant rate of increase of the time series in the range vector)

## count_scalar()函数 : 指将时间序列向量中的元素个数作为标量返回(returns the number of

elements in a time series vector as a scalar)

2.CPU负载率

node_load1{instance="134node"} / count by(job, instance)(count by(job, instance, cpu)(node_cpu{instance="134node"}))

注释:

## node_load1 : 指1分钟内cpu平均负载,同样cpu_load5指5分钟内cpu平均负载,cpu_load15指15

分钟内cpu平均负载

## count : 指聚合向量中的每个元素(即计数)

## 待添加后续注解

3.可用内存

node_memory_MemAvailable{instance="88node"}

注释:

## node_memory_MemAvailable :Memory information field MemAvailable, node-exporter已经抓取出来,只需查询展示即可;

注意:该指标针对不同的系统是采集不同的,CentOS6.X 上就采集不到这个指标;CentOS7上可以;

4.空闲文件系统空间

sum(node_filesystem_free{fstype="xfs",instance="88node"})

sum(node_filesystem_free{fstype="ext4",instance="134node"})

## node_filesystem_free: Filesystem free space in bytes

## fstype 有如下种类:

## aufs :  指联合文件系统,用来把原本分离的两个文件系统联合在一起

## cgroup : Cgroups(控制组)是Linux内核的一个功能,用来限制、统计和分离一个进程组的资源

(CPU、内存、磁盘输入输出等)。

## tmpfs : tmpfs是一种虚拟内存文件系统,而不是块设备。

## overlay : 一个 overlay 文件系统包含两个文件系统,一个 upper 文件系统和一个 lower 文件系

统,是一种新型的联合文件系统

### proc、xfs、mqueue等等。

5.swap硬盘交换区:从硬盘到内存或从内存到硬盘,虚拟内存交换

Swap free :

node_memory_SwapFree{instance="134node"}

## node_memory_SwapTotal: Memory information field SwapTotal.

## swap :类似于可以把硬盘当内存用,那么这一部分内存一般就叫做swap

Swap Usage :

node_memory_SwapTotal{instance="134node"} - node_memory_SwapFree{instance="134node"}

## node_memory_SwapFree: Memory information field SwapFree

Swap I/O(in):

rate(node_vmstat_pswpin{instance="88node"}[1m]) * 4096 or irate(node_vmstat_pswpin{instance="88node"}[5m]) * 4096

Swap I/O(out):

rate(node_vmstat_pswpout{instance="88node"}[1m]) * 4096 or irate(node_vmstat_pswpout{instance="88node"}[5m]) * 4096

## vmstat :vmstat命令是最常见的Linux/Unix监控工具,可以展现给定时间间隔的服务器的状态值,

包括服务器的CPU使用率,内存使用,虚拟内存交换情况,IO读写情况。

## pswpin/s:每秒从硬盘交换区传送进入内存的次数。

## pswpout/s:每秒从内存传送到硬盘交换区的次数。

## pswpin/s、 pswpout/s描述的是与硬盘交换区相关的交换活动。交换关系到系统的效率。交换区在

硬盘上对硬盘的读,写操作比内存读,写慢得多,因此,为了提高系统效率就应该设法减少交换。

通常的作法就是加大内存,使交换区中进行的交换活动为零,或接近为零。如果swpot/s的值大

于 1,预示可能需要增加内存或减少缓冲区(减少缓冲区能够释放一部分自由内存空间)。

Swap free 率(百分百)

(node_memory_SwapFree{instance=~"$server"}  /node_memory_SwapTotal{instance=~"$server"}) * 100

6.CPU使用率

avg without (cpu) (irate(node_cpu{instance="88node", mode!="idle"}[5m]))

## avg : 平均值

7.网路使用情况

上传速率:

irate(node_network_transmit_bytes{device!="lo",instance="88node"}[1m])

下载速率:

irate(node_network_receive_bytes{device!="lo",instance="88node"}[1m])

## eth0: ethernet的简写,一般用于以太网接口。

## wifi0:wifi是无线局域网,因此wifi0一般指无线网络接口。

## ath0: Atheros的简写,一般指Atheros芯片所包含的无线网络接口。

## tunl0:tunl0是隧道接口,封装数据的时候使用

## lo: local的简写,一般指本地环回接口。

8.内存使用率

已用内存:(总内存-空闲内存-缓存=已使用内存)

node_memory_MemTotal{instance="88node"} -

node_memory_MemFree{instance="88node"} -

node_memory_Cached{instance="88node"} -

node_memory_Buffers{instance="88node"} -

node_memory_Slab{instance="88node"}

Buffer缓存:

node_memory_Buffers{instance="88node"}

Cached缓存:

node_memory_Cached{instance="88node"}

+ node_memory_Slab{instance="88node"}

Free空闲内存:

node_memory_MemFree{instance="88node"}

可用内存占比:

(node_memory_MemAvailable{instance="88node"} /

node_memory_MemTotal{instance="88node"}) * 100

## total:总计物理内存的大小。

## Free:空闲内存有多少。

## Shared:多个进程共享的内存总额。

## Buffers:表示buffers cache的内存数量,一般对块设备的读写才需要缓冲

## Cached:表示page cached的内存数量,一般作文件系统的cached,频繁访问的文件都会被

cached。如果cached值较大,就说明cached文件数较多。如果此时IO中的bi比较小,就

说明文件系统效率比较好

## Slab:slab分配器不仅可以提供动态内存的管理功能,而且可以作为经常分配并释放的内存的缓存

## MemAvailable: Free + Buffers + Cached - 不可回收的部分。不可回收部分包括:共享内存段,

tmpfs,ramfs等

9.磁盘读写(IOPs)

磁盘每秒读取(5分钟内)

sum by (instance) (irate(node_disk_reads_completed{instance="88node"}[5m]))

##node_disk_reads_completed: The total number of reads completed successfully

磁盘每秒写入(5分钟内)

sum by (instance)(irate(node_disk_writes_completed{instance="88node"}[5m]))

##node_disk_writes_completed :The total number of writes completed successfully.

使用I/O的毫秒数(5分钟内)

sum by (instance) (irate(node_disk_io_time_ms{instance="88node"}[5m]))

##node_disk_io_time_ms: Total Milliseconds spent doing I/Os

磁盘每秒读写总数(5分钟内)

sum by (instance) (irate(node_disk_reads_completed{instance="88node"}[5m])) + sum by (instance) (irate(node_disk_writes_completed{instance="88node"}[5m]))

10.I/O Usage

磁盘读取总数(1分钟内)

sum(irate(node_disk_bytes_read{instance="88node"}[1m]))

##node_disk_bytes_read : The total number of bytes read successfully(成功读取的字节数)

磁盘写入总数(1分钟内)

sum(irate(node_disk_bytes_written{instance="88node"}[1m]))

##node_disk_bytes_written :The total number of bytes written successfully(成功写入的字节数)

使用I/O的毫秒数(1分钟内)

sum(irate(node_disk_io_time_ms{instance="88node"}[1m]))

##node_disk_io_time_ms :Total Milliseconds spent doing I/Os.(使用IO的总毫秒数)

11.文件系统空闲空间

最低值:

min(node_filesystem_free{fstype=~"xfs|ext4",instance="88node"} / node_filesystem_size{fstype=~"xfs|ext4",instance="88node"})

最高值:

max(node_filesystem_free{fstype=~"xfs|ext4",instance="88node"} / node_filesystem_size{fstype=~"xfs|ext4",instance="88node"})

## ext4是第四代扩展文件系统(英语:Fourth EXtended filesystem,缩写为ext4)是linlli

linux下的日志文件系统,ext4的文件系统容量达到1EB,而文件容量则达到16TB

## XFS是一个64位文件系统,最大支持8EB减1字节的单个文件系统,实际部署时取决于宿主操作系

统的最大块限制。对于一个32位linux系统,文件和文件系统的大小会被限制在16TB。

node-exporter常用指标含义,比如在prometheus中查询node_load1的指标数据的更多相关文章

  1. Prometheus + Node Exporter + Grafana 监控主机运行信息

      上一篇文章中讲了如何利用Prometheus和Grafana监控SpringBoot应用的JVM信息,这次就来看看如何监控 服务器运行状态,先列出用到的工具: Prometheus node_ex ...

  2. Prometheus监控node-exporter常用指标含义

    一.说明 最近使用Prometheus新搭建监控系统时候发现内存采集时centos6和centos7下内存监控指标采集计算公式不相同,最后采用统一计算方法并整理计算公式如下: 1 100-(node_ ...

  3. Prometheus 集成 Node Exporter

    文章首发于公众号<程序员果果> 地址:https://mp.weixin.qq.com/s/40ULB9UWbXVA21MxqnjBxw 简介 Prometheus 官方和一些第三方,已经 ...

  4. 【开源监控】Prometheus+Node Exporter+Grafana监控linux服务器

    Prometheus Prometheus介绍 Prometheus新一代开源监控解决方案.github地址 Prometheus主要功能 多维 数据模型(时序由 metric 名字和 k/v 的 l ...

  5. Node Exporter监控指标

    访问http://localhost:9100/metrics,可以看到当前node exporter获取到的当前主机的所有监控数据,如下所示: 每一个监控指标之前都会有一段类似于如下形式的信息: # ...

  6. Prometheus exporter的Node exporter是可以独立安装,用来测试的

    现在慢慢在把prometheus operator的一些概念组织完整. https://github.com/coreos/prometheus-operator/tree/master/contri ...

  7. Prometheus 使用之 node exporter

    本文使用的 Prometheus 版本为 2.22.0,node exporter 版本为 1.0.1:部署在 Linux 服务器Prometheus 是开源的监控报警系统和时序列数据库 (TSDB) ...

  8. Prometheus Node_exporter 之 Node Exporter

    Node Exporter 1. Node Exporter Scrape Time type: GraphUnit: secondsLabel: Seconds{{collector}} - 各个收 ...

  9. 时序数据库连载系列:指标届的独角兽Prometheus

    简介 Prometheus是SoundCloud公司开发的一站式监控告警平台,依赖少,功能齐全.于2016年加入CNCF,广泛用于 Kubernetes集群的监控系统中,2018.8月成为继K8S之后 ...

随机推荐

  1. XGBoost使用教程(进阶篇)三

    一.Importing all the libraries import pandas as pdimport numpy as npfrom matplotlib import pyplot as ...

  2. BeyondCorps

    This repository provides a short description of the BeyondCorp security model and resources for impl ...

  3. 201871010133-赵永军《面向对象程序设计(java)》第二周学习总结

    201871010133-赵永军<面向对象程序设计(java)>第二周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这 ...

  4. First Chance Exception是什么?

    是否调试过应用程序并在输出窗口中看到有关“First Chance”异常的消息?有没有想过: 什么是First Chance Exception? 第一次机会异常是否意味着我的代码中存在问题? 在调试 ...

  5. es4x 引用外部jar 包以及集成typescrip

    以前写过一个通过修改jar 包处理自定义jar 的引入的,如下是一种使用官方推荐的方法package.json 添加依赖配置 同时为了方便使用添加typescript define 文件方便使用(只是 ...

  6. ESP8266 LUA脚本语言开发: 准备工作-官网获取LUA固件

    前言 这节咱去官网上获取lua开发的固件. 官网下载 下面是我以前写的,咱不使用官网下载的固件,咱使用自己编译的固件.. 填写好自己的的邮箱地址,然后选择好自己需要的功能,一会编译好的固件就会发到您的 ...

  7. ERROR:Simulator861-Failed to link the design解决办法

    在安装目录下找到collect2.exe文件,删除就可以解决了.D:\install_dir\ISE2\14.7\ISE_DS\ISE\gnu\MinGW\5.0.0\nt\libexec\gcc\m ...

  8. jedis代码操作

    一.jedis快速入门 * Jedis: 一款java操作redis数据库的工具. * 使用步骤: 1. 下载jedis的jar包 2. 使用 //1. 获取连接 Jedis jedis = new ...

  9. python3 mqtt 添加用户名以及密码

    import paho.mqtt.client as mqtt client = mqtt.Client(client_id, transport='tcp') client.username_pw_ ...

  10. python总结五

    1.is和==的区别:官方文档解释:is表示的是对象标识符,而==表示的是相等equal,is的作用是用来检查对象的标识符是否一致,也就是两个对象在内存中的地址是否一样 而==是用来检查两个对象是否相 ...