快猫监控
夜莺监控V6
夜莺监控V5
Categraf
Telegraf
Prometheus
版权声明
第1章:天降奇兵
第2章:探索PromQL
开篇
理解时间序列
Metrics类型
初识PromQL
PromQL操作符
PromQL聚合操作
PromQL内置函数
在HTTP API中使用PromQL
最佳实践:4个黄金指标和USE方法
小结
第3章:Prometheus告警处理
开篇
Prometheus告警简介
自定义Prometheus告警规则
部署Alertmanager
Alertmanager配置概述
基于标签的告警处理路由
使用Receiver接收告警信息
告警模板详解
屏蔽告警通知
使用Recoding Rules优化性能
小结
第4章:Exporter详解
第5章:数据与可视化
第6章:集群与高可用
第7章:Prometheus服务发现
第8章:监控Kubernetes
开篇
初识Kubernetes
在Kubernetes下部署Prometheus
Kubernetes下的服务发现
使用Prometheus监控Kubernetes集群
基于Prometheus的弹性伸缩
小结
第9章:Prometheus Operator
参考资料
智能告警
基础指标采集插件
cpu 插件
功能: 采集cpu指标,包括cpu用户态/系统态使用量、中断、软中断等指标
注
- 如果不需要采集单个核心指标,推荐保持默认配置。
- 如果想修改插件的采集周期,在这里修改
interval
的值
# # collect interval
# interval = 15
# # whether collect per cpu
# collect_per_cpu = false
mem 插件
功能: 采集内存指标,包括内存使用量、总量、cache、buffer、 available等指标
- 如果想修改插件的采集周期,在这里修改
interval
的值 - 其中配置项
collect_platform_fields
表示是否采集平台独有的指标
# # collect interval
# interval = 15
# # whether collect platform specified metrics
collect_platform_fields = true
disk 插件
功能:采集各个磁盘分区的空间/inode的使用量情况
注: 每个指标都有一个mode=rw
类似的label , 表示分区的挂载模式。
- 分区变为只读监控: 可以通过指标携带的label
mode=xx
来实现, 比如disk_use_total{mode="ro"} > 0
- 磁盘故障监控: 可以通过
disk_device_error == 1
判断 - 如果想修改插件的采集周期,在这里修改
interval
的值
# # collect interval
# interval = 15
# # By default stats will be gathered for all mount points.
# # Set mount_points will restrict the stats to only the specified mount points.
# mount_points = ["/"]
# Ignore mount points by filesystem type.
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs", "nsfs"]
ignore_mount_points = ["/boot", "/var/lib/kubelet/pods"]
diskio 插件
功能: 采集磁盘io指标,包括读写速率,读写次数,读写延迟等
- 如果想修改插件的采集周期,在这里修改
interval
的值 - 可以通过devices参数限定只采集哪几块盘的指标
# # collect interval
# interval = 15
# # By default, categraf will gather stats for all devices including disk partitions.
# # Setting devices will restrict the stats to the specified devices.
# devices = ["sda", "sdb", "vd*"]
net插件
功能: 采集网络指标,包括网卡流量,包数,错误数等
注意:
- 如果想修改插件的采集周期,在这里修改
interval
的值 collect_protocol_stats
这个选项只在Linux下生效,如果不需要采集协议层指标,可以关闭该选项, 推荐保持默认。interfaces
指定采集的网卡,如果不配置,默认为全部网卡。 支持通配符配置。
# # collect interval
# interval = 15
# # whether collect protocol stats on Linux
# # to be supported
# collect_protocol_stats = false
# # setting interfaces will tell categraf to gather these explicit interfaces
# interfaces = ["eth0"]