This is an automated email from the ASF dual-hosted git repository.

gongchao pushed a commit to branch integte-extern-alarm
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git

commit a1d443424237b5d8c90b6ca55071d93d8d2358a2
Author: tomsun28 <tomsu...@outlook.com>
AuthorDate: Fri Jan 10 20:27:32 2025 +0800

    [improve] init
    
    Signed-off-by: tomsun28 <tomsu...@outlook.com>
---
 .../alert-integration.component.ts                 |  5 ++++
 .../assets/doc/alert-integration/webhook.en-US.md  |  7 +++++
 .../assets/doc/alert-integration/webhook.zh-CN.md  | 32 ++++++++++++++++++++++
 .../assets/doc/alert-integration/webhook.zh-TW.md  |  0
 web-app/src/assets/i18n/en-US.json                 |  2 +-
 web-app/src/assets/i18n/zh-CN.json                 |  3 +-
 web-app/src/assets/img/integration/tencent.svg     |  2 +-
 7 files changed, 48 insertions(+), 3 deletions(-)

diff --git 
a/web-app/src/app/routes/alert/alert-integration/alert-integration.component.ts 
b/web-app/src/app/routes/alert/alert-integration/alert-integration.component.ts
index 3df9132829..0a4802b007 100644
--- 
a/web-app/src/app/routes/alert/alert-integration/alert-integration.component.ts
+++ 
b/web-app/src/app/routes/alert/alert-integration/alert-integration.component.ts
@@ -24,6 +24,11 @@ const MARKDOWN_DOC_PATH = './assets/doc/alert-integration';
 })
 export class AlertIntegrationComponent implements OnInit {
   dataSources: DataSource[] = [
+    {
+      id: 'webhook',
+      name: this.i18nSvc.fanyi('alert.integration.source.webhook'),
+      icon: 'assets/logo.svg'
+    },
     {
       id: 'prometheus',
       name: this.i18nSvc.fanyi('alert.integration.source.prometheus'),
diff --git a/web-app/src/assets/doc/alert-integration/webhook.en-US.md 
b/web-app/src/assets/doc/alert-integration/webhook.en-US.md
new file mode 100644
index 0000000000..b876d8a96d
--- /dev/null
+++ b/web-app/src/assets/doc/alert-integration/webhook.en-US.md
@@ -0,0 +1,7 @@
+# Prometheus Alert Integration
+
+HertzBeat is fully compatible with Prometheus alert data format. You can 
configure Prometheus alerting rules to send alerts to HertzBeat.
+
+## Prometheus Alert Configuration
+
+Add the following configuration to your Prometheus configuration file:
diff --git a/web-app/src/assets/doc/alert-integration/webhook.zh-CN.md 
b/web-app/src/assets/doc/alert-integration/webhook.zh-CN.md
new file mode 100644
index 0000000000..50880bd187
--- /dev/null
+++ b/web-app/src/assets/doc/alert-integration/webhook.zh-CN.md
@@ -0,0 +1,32 @@
+## 告警字段說明
+
+- `alert`: 告警規則名稱
+- `expr`: 告警觸發條件表達式
+- `for`: 告警持續時間閾值
+- `labels`: 告警標籤
+  - `severity`: 告警級別 (warning, critical)
+- `annotations`: 告警註釋信息
+  - `summary`: 告警摘要
+  - `description`: 告警詳細描述
+
+## 驗證配置
+
+1. 確保 Prometheus 配置正確並重新加載配置
+   ```bash
+   curl -X POST http://localhost:9090/-/reload
+   ```
+
+2. 檢查 Prometheus 告警規則狀態
+   ```bash
+   curl http://localhost:9090/api/v1/rules
+   ```
+
+3. 觸發測試告警並在 HertzBeat 告警中心查看
+
+## 常見問題
+
+1. 確保 HertzBeat URL 可以被 Prometheus 服務器訪問
+2. 檢查 Prometheus 日誌中是否有告警發送失敗的錯誤信息
+3. 驗證告警規則表達式的正確性
+
+更多信息請參考 [Prometheus 
告警配置文檔](https://prometheus.io/docs/alerting/latest/configuration/)
diff --git a/web-app/src/assets/doc/alert-integration/webhook.zh-TW.md 
b/web-app/src/assets/doc/alert-integration/webhook.zh-TW.md
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/web-app/src/assets/i18n/en-US.json 
b/web-app/src/assets/i18n/en-US.json
index 0b7c7d852b..d8f642e562 100644
--- a/web-app/src/assets/i18n/en-US.json
+++ b/web-app/src/assets/i18n/en-US.json
@@ -45,7 +45,7 @@
       "setting": "Threshold Rule",
       "silence": "Alarm Silence",
       "dispatch": "Notification",
-      "integration": "Integration",
+      "integration": "Integration"
     },
     "advanced": {
       "": "Advanced",
diff --git a/web-app/src/assets/i18n/zh-CN.json 
b/web-app/src/assets/i18n/zh-CN.json
index 81a32a0a12..5320cecaa1 100644
--- a/web-app/src/assets/i18n/zh-CN.json
+++ b/web-app/src/assets/i18n/zh-CN.json
@@ -379,7 +379,8 @@
   "alert.notice.sender.sms.tencent.templateId": "腾讯短信TemplateId",
   "alert.export.switch-type": "请选择导出文件格式!",
   "alert.export.use-type": "以 {{type}} 文件格式导出阈值规则",
-  "alert.integration.source": "集成源",
+  "alert.integration.source": "集成告警源",
+  "alert.integration.source.webhook": "默认Webhook",
   "alert.integration.source.prometheus": "Prometheus",
   "alert.integration.source.tencent": "腾讯云监控",
   "dashboard.alerts.title": "最近告警列表",
diff --git a/web-app/src/assets/img/integration/tencent.svg 
b/web-app/src/assets/img/integration/tencent.svg
index 8c3844659a..46d45b869b 100644
--- a/web-app/src/assets/img/integration/tencent.svg
+++ b/web-app/src/assets/img/integration/tencent.svg
@@ -1 +1 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";><svg 
t="1736479945195" class="icon" viewBox="0 0 1446 1024" version="1.1" 
xmlns="http://www.w3.org/2000/svg"; p-id="7192" 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="180.75" height="128"><path 
d="M994.674225 954.138598c0-1.00088-1.00088-1.50132-2.001759-1.000879-12.510996 
14.012316-31.52771 25.021992-55.048382 25.021992-35.531229 0-58.551461-24.52155 
[...]
\ No newline at end of file
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";><svg 
t="1736510338844" class="icon" viewBox="0 0 1402 1024" version="1.1" 
xmlns="http://www.w3.org/2000/svg"; p-id="5142" 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="175.25" height="128"><path 
d="M1215.068154 831.197568a199.23384 199.23384 0 0 1-148.202014 
58.441927l-477.741777 1.258319c148.202014-142.329859 263.967361-265.64512 
276.830178-271.796902 [...]
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@hertzbeat.apache.org
For additional commands, e-mail: notifications-h...@hertzbeat.apache.org

Reply via email to