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 ...
随机推荐
- 开源虚拟化KVM(三)管理虚拟网络
六,管理虚拟网络 [x] Linux网桥基本概念 [x] qemu-kvm支持的网络 [x] 向虚拟机添加虚拟网络连接 [x] 基于NAT的虚拟网络 [x] 基于网桥的虚拟网络 [x] 用户自定义的隔 ...
- python 决策树
RID age income student credit_rating Class:buys_computer 1 youth high no fair no 2 youth high no exc ...
- mysql与cmd,中文乱码
图中第一次select, 通过navicat插入表中的, 下面的这次select结果,是直接在命令行中插入的,中文就显示了两个问号...搞不懂咋回事..我是win10家庭版系统.....希望各位道友谨 ...
- jmeter连接oracle数据库配置
1导入加载ojdbc.jar包(2种方法) 1)直接拷贝目录 2.
- pyinstaller,scrapy和apscheduler
一.scrapy拉起方式 1. 简单cmd拉起 from scrapy.cmdline import execute spiders = [ 'scrapy crawl liepin', 'scrap ...
- git 安装及常见问题处理
卸载掉自带的: yum remove git 安装: yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-de ...
- jQuery实现动态分割div
转自:https://www.cnblogs.com/herd/p/6014848.html 演示地址:http://www.vfkjsd.cn/div/2/div.html
- Spring Cloud+Dubbo对Feign进行RPC改造
因为Spring Cloud Feign是基于Http Restful的调用,在高并发下的性能不够理想(虽然他是基于Ribbon以及带有熔断机制,可以防止雪崩),成为性能瓶颈,所以我们今天对Feign ...
- 1-蓝桥杯套路-java
决定参加蓝桥杯用java了,当然得重新刷点题目,熟悉一下,以后要是考研失败了,可能回去找java的工作!!! 经验贴: 1. https://blog.csdn.net/wqy20140101/art ...
- skyline开发——读取Shapefile要素属性
double len; IFeatures66 features = featureLayer.FeatureGroups.Polyline.GetCurrentFeatures(); foreach ...