Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: alert writes to elasticsearch #173

Merged
merged 2 commits into from
Dec 22, 2021
Merged

Add: alert writes to elasticsearch #173

merged 2 commits into from
Dec 22, 2021

Conversation

Zhang21
Copy link
Contributor

@Zhang21 Zhang21 commented Dec 22, 2021

增加支持将Prometheus告警记录写入到Elasticsearch7.x,可通过Kibana进行界面查看告警记录和配置表格导出。

@feiyu563 feiyu563 merged commit 0787b42 into feiyu563:master Dec 22, 2021
@feiyu563
Copy link
Owner

非常感谢

feiyu563 added a commit that referenced this pull request Feb 22, 2022
Add: alert writes to elasticsearch
feiyu563 added a commit that referenced this pull request Feb 22, 2022
Add: alert writes to elasticsearch
feiyu563 added a commit that referenced this pull request Feb 22, 2022
Add: alert writes to elasticsearch
@trestea
Copy link

trestea commented Apr 6, 2022

使用es7.14 并没有存储告警信息,配置如下:
#是否开启告警记录 0为关闭,1为开启
AlertRecord=1
alert_to_es=1
to_es_url=http://10.170.3.11:9200
to_es_user=elastic
to_es_pwd=fdasrer

@Zhang21
Copy link
Contributor Author

Zhang21 commented Apr 6, 2022

使用es7.14 并没有存储告警信息,配置如下: #是否开启告警记录 0为关闭,1为开启 AlertRecord=1 alert_to_es=1 to_es_url=http://10.170.3.11:9200 to_es_user=elastic to_es_pwd=fdasrer

你提个issue,写下应用的tag和commit,贴下程序启动时候的日志。

@junun
Copy link

junun commented Apr 6, 2023

1, app.conf
AlertRecord=1
alert_to_es=1
to_es_url=http://x.x.x.x:9200/
to_es_user=elastic
to_es_pwd=xxxx

2, version info
2023/04/06 17:57:41.809 [I] [proc.go:255] [main] 构建的Go版本: go1.17.5
2023/04/06 17:57:41.809 [I] [proc.go:255] [main] 应用当前版本: 'v4.8.2'
2023/04/06 17:57:41.809 [I] [proc.go:255] [main] 应用当前提交: eb8600a
2023/04/06 17:57:41.809 [I] [proc.go:255] [main] 应用构建时间: 2022-06-24T15:42:46+0800
2023/04/06 17:57:41.809 [I] [proc.go:255] [main] 应用构建用户: root@bogon
2023/04/06 17:57:41.828 [I] [asm_amd64.s:1581] http server Running on http://0.0.0.0:8080

3, error log:
2023/04/06 16:05:57.678 [E] [prometheusalert.go:372] [elasticsearch] Index a prometheusalert alert to es error: elastic: Error 400 (Bad Request): Rejecting mapping update to [prometheusalert-20234] as the final mapping would have more than 1 type: [_doc, prometheusalert] [type=illegal_argument_exception]

4, es version
7.10.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants