当前位置:网站首页>Prometheus alarm record persistence (historical alarm saving and Statistics)
Prometheus alarm record persistence (historical alarm saving and Statistics)
2022-04-23 07:05:00 【A sunny afternoon】
I came across a need some time ago : take Prometheus Persistent storage of historical alarms , Analyze and count again . After trying some tools , And finally alertsnitch+grafana The plan .
alertsnitch: https://gitlab.com/yakshaving.art/alertsnitch
Briefly introduce the principle of this tool ,alertsnitch Implemented a webhook, By means of alertmanager Middle configuration receiver by alertsbnitch webhook Send the alarm to alertsnitch,alertsnitch The data is processed and stored in Mysql/Postgre, For detailed introduction, please refer to its gitlab Home page .
Here is a brief introduction to how to use (k8s install , Database usage Mysql)
1、Mysql establish alertsnitch Database used and corresponding account , A little .
2、 install alertsnitch, Modify the following ALERTSNITCH_DSN Value
# alertsnitch-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: alertsnitch
namespace: alertmanager
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: alertsnitch
template:
metadata:
labels:
app.kubernetes.io/name: alertsnitch
spec:
containers:
- image: registry.gitlab.com/yakshaving.art/alertsnitch
name: alertsnitch
ports:
- containerPort: 9567
name: http
env:
- name: ALERTSNITCH_BACKEND
value: mysql
- name: ALERTSNITCH_DSN
value: ${MYSQL_USER}:${MYSQL_PASSWORD}(${MYSQL_IP}:${MYSQL_PORT})/{$MYSQL_DATABASE}
readinessProbe:
httpGet:
path: /-/ready
port: 9567
initialDelaySeconds: 30
periodSeconds: 10
livenessProbe:
httpGet:
path: /-/health
port: 9567
initialDelaySeconds: 60
periodSeconds: 10
apiVersion: v1
kind: Service
metadata:
name: alertsnitch
namespace: alertmanager
spec:
ports:
- name: http
port: 9567
targetPort: http
selector:
app.kubernetes.io/name: alertsnitch
3、 To configure alertmanager
route:
receiver: all
routes:
# All alarm collection
- receiver: all
continue: true
--------------------
receivers:
#alertsnitch
- name: 'all'
webhook_configs:
- url: 'http://alertsnitch.alertmanager.svc:9567/webhook'
send_resolved: true
4、 have access to grafana To display and count historical alarms , Make a ready-made for reference
版权声明
本文为[A sunny afternoon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230600558319.html
边栏推荐
- 异常记录-12
- js 函数包裹forEach中使用return跳不出外层函数
- 基於ECS搭建雲上博客(雲小寶碼上送祝福,免費抽iphone13任務詳解)
- virtio 与vhost_net介绍
- VirtualBox如何修改“网络地址转换(NAT)”网络模式下分配给虚拟机的IP网段
- Oracle性能分析工具:OSWatcher
- 用反射与注解获取两个不同对象间的属性值差异
- Oracle Net Service:监听器与服务名解析方法
- How to use tiup to deploy a tidb V5 0 cluster
- Ali vector library Icon tutorial (online, download)
猜你喜欢
Kids and COVID: why young immune systems are still on top
Basic concepts of database: OLTP / OLAP / HTAP, RPO / RTO, MPP
rdma 编程详解
使用prom-label-proxy实现Prometheus Thanos的基于标签的多租户读
Prometheus Cortex架构概述(水平可扩展、高可用、多租户、长期存储)
[ES6 quick start]
Thanos compact component test summary (processing historical data)
你应该知道的 JVM 基础知识
Virtio and Vhost_ Net introduction
Redis practice notes and source code analysis
随机推荐
【不积跬步无以至千里】MySQL报大量unauthenticated user连接错误
JS function package foreach use return can not jump out of the outer function
异常记录-6
基于EMR离线数据分析-反馈有礼
"Write multi tenant" implementation of Prometheus and thanos receiver
Winter combat camp hands-on combat - MySQL database rapid deployment practice lead mouse cloud Xiaobao
Oracle数据库性能分析之常用视图
异常记录-12
Oracle Performance Analysis Tool: oswatcher
JS implementation of web page rotation map
Introduction to the top 12 domestic databases in 2021
SSM项目在阿里云部署
[MySQL basics] startup options and configuration files
Passerelle haute performance pour l'interconnexion entre VPC et IDC basée sur dpdk
OVS and OVS + dpdk architecture analysis
js 格式化当前时间 日期推算
[ES6 quick start]
基於DPDK實現VPC和IDC間互聯互通的高性能網關
【不积跬步无以至千里】Oracle应用导数Ora-01455报错处理
重启Oracle监听器会中断已有连接吗