-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from Zhang21/master
Add: alert writes to elasticsearch
- Loading branch information
Showing
736 changed files
with
114,675 additions
and
3,533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 告警记录写入Elasticsearch | ||
|
||
**注意**: | ||
- 客户端适配的是ES7.x版本! | ||
- 索引根据年月动态创建`prometheusalert-YYMM`(如prometheusalert-202112) | ||
|
||
|
||
<br/> | ||
<br/> | ||
|
||
|
||
## es相关配置 | ||
|
||
```conf | ||
# 是否将告警记录写入es7,0为关闭,1为开启 | ||
alert_to_es=0 | ||
# es地址,是[]string | ||
# beego.AppConfig.Strings读取配置为[]string,使用";"而不是"," | ||
# 单个地址 | ||
to_es_url=http://localhost:9200 | ||
# 多个地址 | ||
# to_es_url=http://es1:9200;http://es2:9200;http://es3:9200 | ||
# 是否有认证,es用户和密码, 无认证则不需要填写。 | ||
# to_es_user=username | ||
# to_es_pwd=password | ||
``` | ||
|
||
|
||
<br/> | ||
<br/> | ||
|
||
|
||
## Kibana展示效果 | ||
|
||
可直接创建索引模式展示告警记录。还可以自行创建表格、柱状图等展示。 | ||
|
||
![kibana-index](/doc/images/kibana-index.png) | ||
|
||
<br/> | ||
|
||
![kibana-table](/doc/images/kibana-table.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.