Prometheus Alert Rules with Some Metrics
Using Prometheus as a monitor system, it is quite efficent. The most important one is that alert template is quite flexible,
I can alert the message with some other metrics value except the current metric value, it is quite convient. For example,
groups:
- name: example
rules:
- alert: Load alert
expr: node_load1 >
for: 5s
labels:
severity: page
annotations:
title: 'load1: {{ $value }}, load5: {{ printf `node_load5{instance="%s"}` $labels.instance | query | first | value }}, load15: {{ printf `node_load15{instance="%s"}` $labels.instance | query | first | value}}'
summary: High load
After configuring alertmanager and adding webhook_configs, I can capture the result of alert as following:
{"receiver":"default","status":"firing","alerts":[{"status":"firing","labels":{"alertname":"Load alert","instance":"127.0.0.1:9100","job":"prometheus","severity":"page"},"annotations":{"summary":"High load","title":"load1: 60.1494140625, load5: 38.009765625, load15: 23.18359375"},"startsAt":"2018-07-15T22:59:09.508199934+08:00","endsAt":"0001-01-01T00:00:00Z","generatorURL":"http://bogon:9090/graph?g0.expr=node_load1+%3E+1\u0026g0.tab=1"}],"groupLabels":{},"commonLabels":{"alertname":"Load alert","instance":"127.0.0.1:9100","job":"prometheus","severity":"page"},"commonAnnotations":{"summary":"High load","title":"load1: 60.1494140625, load5: 38.009765625, load15: 23.18359375"},"externalURL":"http://bogon:9093","version":"","groupKey":"{}:{}"}
We can get the values of load average in annotations:
load1: 60.1494140625, load5: 38.009765625, load15: 23.18359375
Afert receiving the message, we know the detail of load average in a machine.
Prometheus Alert Rules with Some Metrics的更多相关文章
- prometheus alert rules文件格式化
1.下载go(version>1.9,否则promtool工具不好使) https://golang.org/doc/install?download=go1.10.2.linux-amd64. ...
- 使用prometheus抓取k8s的metrics作监控时,cAdvisor和kubelet配置有何差别?
按网上说法: 目前cAdvisor集成到了kubelet组件内,可以在kubernetes集群中每个启动了kubelet的节点使用cAdvisor提供的metrics接口获取该节点所有容器相关的性能指 ...
- Prometheus 入门与实践
原文链接:https://www.ibm.com/developerworks/cn/cloud/library/cl-lo-prometheus-getting-started-and-practi ...
- 0基础入门 docker 部署 各种 Prometheus 案例 - 程序员学点xx 总集篇
目录 大家好, 学点xx 系列也推出一段时间了.虽然 yann 能力有限,但还是收到了很多鼓励与赞赏.对这个系列 yann 还是很喜欢的,特别是 Prometheus 篇,在期间经历公众号 100 篇 ...
- SpringBoot进阶教程(七十一)详解Prometheus+Grafana
随着容器技术的迅速发展,Kubernetes已然成为大家追捧的容器集群管理系统.Prometheus作为生态圈Cloud Native Computing Foundation(简称:CNCF)中的重 ...
- 监控生产线上服务器的docker容器及主机
1. 部署cadvisor容器,用来收集host上的容器信息,该容器部署在需要收集容器信息的每一个主机上部署: docker run -v /:/rootfs:ro -v /var/run:/var ...
- Spring Boot Metrics监控之Prometheus&Grafana(转)
欢迎来到Spring Boot Actuator教程系列的第二部分.在第一部分中,你学习到了spring-boot-actuator模块做了什么,如何配置spring boot应用以及如何与各样的ac ...
- kubernetes之监控Operator部署Prometheus(三)
第一章和第二章中我们配置Prometheus的成本非常高,而且也非常麻烦.但是我们要考虑Prometheus.AlertManager 这些组件服务本身的高可用的话,成本就更高了,当然我们也完全可以用 ...
- k8s部署prometheus
https://www.kancloud.cn/huyipow/prometheus/527092 https://songjiayang.gitbooks.io/prometheus/content ...
随机推荐
- hadoop更改保存路径后,批量重启不能启动datanode(或者format以后不能启动datanode)
这是因为更改文件后,所有的子节点的core-site.xml并没有一致,所以使用start-dfs.sh的时候导致机器起不起来. 修改slave(datanode)节点的core-site.xml就可 ...
- 变量新声明之let、const
一.let 1.通过let声明变量不会变量声明提升 let a = 10; console.log( a ) 会报错 2. let a = 10; let a = 10; 会报错,(a 已被定义) 3 ...
- Arthas的基础学习
下载与安装 wget https://alibaba.github.io/arthas/arthas-boot.jar java -jar arthas-boot.jar 启动 查看启动的帮助信息: ...
- boss推荐文章
20170216 --- 谁是你的下一个客户?国内 B2B Predictive Marketing 公司浅探(中)https://zhuanlan.zhihu.com/p/25257243?refe ...
- 一起学libcef--搭建自己的libcef运行环境(Win32程序,错误C2220解决方案)
转自 http://blog.csdn.net/wangshubo1989/article/details/50180413 现在就来讲讲如何在自己的win32程序中搭建libcef运行环境. 首先就 ...
- Spring:事务
摘要 本文摘抄了Spring事务相关的一些理论,主要讲述事务的特性.事务的传播行为.事务的隔离规则. 关键词:事务特性,事务传播,事务隔离 一.什么是事务 事务是用来保证数据的完整性和一致性,正如金钱 ...
- POJ-3159.Candies.(差分约束 + Spfa)
Candies Time Limit: 1500MS Memory Limit: 131072K Total Submissions: 40407 Accepted: 11367 Descri ...
- aruba 开启802.1X认证
1.即在ac上指定一个radius server认证 2.创建本地账户测试
- idea连接mysql
https://blog.csdn.net/Golden_soft/article/details/80952243
- LAB6 SOAP
有web服务的,需要Deploy一下才能跑 通过ls看所有文件的所在地,cd进入对应文件夹,才可以编译 javac 编译,Java是执行 URL必须是WSDL文件点进去里面的:http://local ...