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的更多相关文章

  1. prometheus alert rules文件格式化

    1.下载go(version>1.9,否则promtool工具不好使) https://golang.org/doc/install?download=go1.10.2.linux-amd64. ...

  2. 使用prometheus抓取k8s的metrics作监控时,cAdvisor和kubelet配置有何差别?

    按网上说法: 目前cAdvisor集成到了kubelet组件内,可以在kubernetes集群中每个启动了kubelet的节点使用cAdvisor提供的metrics接口获取该节点所有容器相关的性能指 ...

  3. Prometheus 入门与实践

    原文链接:https://www.ibm.com/developerworks/cn/cloud/library/cl-lo-prometheus-getting-started-and-practi ...

  4. 0基础入门 docker 部署 各种 Prometheus 案例 - 程序员学点xx 总集篇

    目录 大家好, 学点xx 系列也推出一段时间了.虽然 yann 能力有限,但还是收到了很多鼓励与赞赏.对这个系列 yann 还是很喜欢的,特别是 Prometheus 篇,在期间经历公众号 100 篇 ...

  5. SpringBoot进阶教程(七十一)详解Prometheus+Grafana

    随着容器技术的迅速发展,Kubernetes已然成为大家追捧的容器集群管理系统.Prometheus作为生态圈Cloud Native Computing Foundation(简称:CNCF)中的重 ...

  6. 监控生产线上服务器的docker容器及主机

    1. 部署cadvisor容器,用来收集host上的容器信息,该容器部署在需要收集容器信息的每一个主机上部署: docker run -v  /:/rootfs:ro -v /var/run:/var ...

  7. Spring Boot Metrics监控之Prometheus&Grafana(转)

    欢迎来到Spring Boot Actuator教程系列的第二部分.在第一部分中,你学习到了spring-boot-actuator模块做了什么,如何配置spring boot应用以及如何与各样的ac ...

  8. kubernetes之监控Operator部署Prometheus(三)

    第一章和第二章中我们配置Prometheus的成本非常高,而且也非常麻烦.但是我们要考虑Prometheus.AlertManager 这些组件服务本身的高可用的话,成本就更高了,当然我们也完全可以用 ...

  9. k8s部署prometheus

    https://www.kancloud.cn/huyipow/prometheus/527092 https://songjiayang.gitbooks.io/prometheus/content ...

随机推荐

  1. Set集合特点

    1,无序(存储和读取的顺序可能不一样) 2,不允许重复(要求元素唯一) 3,无索引

  2. boss推荐文章

    20170216 --- 谁是你的下一个客户?国内 B2B Predictive Marketing 公司浅探(中)https://zhuanlan.zhihu.com/p/25257243?refe ...

  3. docker挂载目录的深入研究

    转载一篇很好的文章: https://www.cnblogs.com/ivictor/p/4834864.html

  4. Linux系统中无iptables文件的解决

    在RHEL 7 / CentOS 7中,firewalld被引入来管理iptables,CentOS7开始,默认是没有iptables的,而是使用firewall防火墙.本文将屏蔽掉firewall, ...

  5. ORACLE升级11g以上之前版本的wm_concat()函数失效

    先执行: create or replace type string_sum_obj as object ( --聚合函数的实质就是一个对象 sum_string ), static function ...

  6. C#移动及改变控件大小

    //代码比较简单,就不多解析了. #region 移动窗体保存数据 Point mouseOff;//鼠标移动位置变量 bool leftFlag; //标志是否为左键 bool largeFlag; ...

  7. HDU - 4858 项目管理

    N个点,M条无向边.现在有Q组操作,一种是给 i号点增加能量,一种是询问 i号点相邻点的能量和(点间有多条边就算两次). 据说暴力能过,但还是用这题学习了一下 点分块 . 度数不超过 sqrt(M) ...

  8. CentOS 7 安装phpredis和redis(接上一篇centos7安装lnmp)

    一.安装扩展phpredis 1.PHP7 安装redis 扩展phpredis cd /root/software wget https://github.com/edtechd/phpredis/ ...

  9. layer弹出层不居中解决方案(转)

    @感谢参考文章 原文内容: 一.问题描述 用layer做操作结果提示时,发现如果页面超出屏幕的高度时,弹出的提示不是屏幕居中,而是在页面高度的中间,如果一个页面的高度比较大,就看不到提示了. 还有一种 ...

  10. swift UIview上添加视频播放

    1. /// 是否显示过广告 private lazy var isLoadAV = false /// 15秒宣传视频 private var play: AVPlayer? /// 宣传视频背景 ...