这里分类和汇总了欣宸的全部原创(含配套源码):https://github.com/zq2599/blog_demos
# 告警规则分组,每一个组下有多个告警规则
groups:
# 组名
- name: cpuAlertGroup
# 告警规则数组
rules:
# 下面是一个具体的告警规则,名为hostCPUUsageTooHigh
- alert: hostCPUUsageTooHigh
# 基于PromQL的具体规则,这里是CPU使用率高于50%
expr: (1 - sum(increase(node_cpu_seconds_total{mode="idle"}[1m])) by (instance) / sum(increase(node_cpu_seconds_total[1m])) by (instance) ) * 100 > 50
# 持续时间,实际情况满足expr后,规则从inactive
for: 30s
# 给规则自身设置标签
labels:
biz_type: cpu_usage
annotations:
# 告警内容摘要,可以用表达式获取变量的值
summary: "Instance {{ $labels.instance }} CPU usgae high"
# 告警内容详情,可以用表达式获取变量的值
description: "{{ $labels.instance }} CPU usage above 50% (current : {{ $value }})"
systemctl restart prometheus
~/bin/ffmpeg -i ~/videos/4kh264.mp4 -c:v libx265 -vtag hvc1 -c:a copy ./output.mp4
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有