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. python 列表去重的几种方法

    1 a = [,,,,,,,,,,] a1 = [] for i in a: if i not a1: a1.append(i) else: continue 2 a = [,,,,,,,,,] a1 ...

  2. python 网络编程粘包解决方案2 + ftp上传 + socketserver

    一.struct 神奇的打包工具 struct 代码: import struct num = 156 #将int类型的数据打包成4个字节的数据 num_stru = struct.pack('i', ...

  3. ./configure -build,-host,-target设置

    build:执行代码编译的主机,正常的话就是你的主机系统.这个参数一般由config.guess来猜就可以.当然自己指定也可以.host:编译出来的二进制程序所执行的主机,因为绝大多数是如果本机编译, ...

  4. 2018-2019-2 《Java程序设计》结对项目阶段总结《四则运算——整数》(二)

    20175218 2018-2019-2 <Java程序设计>结对项目阶段总结<四则运算--整数> 一.需求分析 实现一个命令行程序,要求: 自动生成小学四则运算题目(加,减, ...

  5. 去除web项目中的css、js缓存

    <link rel="stylesheet" type="text/css" href="~/Content/Home.css?param=Ma ...

  6. leetcode 字谜

    242. Valid Anagram Easy 66298FavoriteShare Given two strings s and t , write a function to determine ...

  7. Linux 对信号的总结

    Linux信号_总结 对信号本质的理解: 类似于中断,区别在于中断是由硬件产生的,而信号是由软件实现的. 信号的来源: 触发硬件(触发键盘,或是硬件故障):软件信号函数kill .alarm.seti ...

  8. 项目总结20:阿里云免费https证书申请

    项目总结20:阿里云免费https证书申请 1. 登录阿里云控制台 www.aliyun.com,用账户信息登录 2. 在”产品与服务”搜索SSL,选择SSL证书 3. 点击购买证书 4. 选择” S ...

  9. 【noip模拟赛4】Matrix67的派对 暴力dfs

    [noip模拟赛4]Matrix67的派对   描述 Matrix67发现身高接近的人似乎更合得来.Matrix67举办的派对共有N(1<=N<=10)个人参加,Matrix67需要把他们 ...

  10. swift 关于FDFullscreenPopGesture的右滑返回

    关于导航栏右滑返回的工具库 FDFullscreenPopGesture 是 OC 版本,用了 runtime 等各种骚操作 关于 swift ,我在 UINavigationController 的 ...