File tree Expand file tree Collapse file tree 8 files changed +9
-7
lines changed
internal/prometheus_adapter
scripts/prometheus_adapter Expand file tree Collapse file tree 8 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ internal/prometheus_adapter/
243243│ (自定义服务) │
244244└────────┬────────┘
245245 │ Push
246- │ POST /v1/integrations/prometheus/alerts
246+ │ POST /v1/integrations/alertmanager/webhook
247247 ▼
248248┌─────────────────┐
249249│ 监控告警模块 │
@@ -263,7 +263,7 @@ internal/prometheus_adapter/
263263 - 支持告警恢复状态通知
264264
265265- ** 推送目标** :
266- - URL: ` http://alert-module:8080/v1/integrations/prometheus/alerts `
266+ - URL: ` http://alert-module:8080/v1/integrations/alertmanager/webhook `
267267 - Method: POST
268268 - Content-Type: application/json
269269
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ func getDefaultConfig() *PrometheusAdapterConfig {
105105 ContainerName : "mock-s3-prometheus" ,
106106 },
107107 AlertWebhook : AlertWebhookConfig {
108- URL : "http://alert-module:8080/v1/integrations/prometheus/alerts " ,
108+ URL : "http://alert-module:8080/v1/integrations/alertmanager/webhook " ,
109109 PollingInterval : "10s" ,
110110 },
111111 AlertRules : AlertRulesConfig {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ prometheus:
1010# 告警 Webhook 服务配置
1111alert_webhook :
1212 # 监控告警模块地址
13- url : " http://alert-module:8080/v1/integrations/prometheus/alerts "
13+ url : " http://alert-module:8080/v1/integrations/alertmanager/webhook "
1414 # 轮询间隔
1515 polling_interval : " 10s"
1616
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ type AlertmanagerWebhookRequest struct {
3939 Alerts []AlertmanagerWebhookAlert `json:"alerts"`
4040 GroupLabels map [string ]string `json:"groupLabels"` // 分组标签
4141 CommonLabels map [string ]string `json:"commonLabels"` // 公共标签
42+ Alert string `json:"alert"` // "REDACTED"
4243 Version string `json:"version"` // "4"
4344}
4445
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ func (s *AlertmanagerService) forwardAlertsV2(alerts []model.AlertmanagerAlert)
176176 Alerts : webhookAlerts ,
177177 GroupLabels : groupLabels ,
178178 CommonLabels : commonLabels ,
179+ Alert : "REDACTED" ,
179180 Version : "1" ,
180181 }
181182
Original file line number Diff line number Diff line change 22
33# 测试增量更新告警规则功能
44
5- BASE_URL=" http://localhost :9999"
5+ BASE_URL=" http://10.210.10.33 :9999"
66
77echo " === 测试增量更新告警规则 ==="
88
Original file line number Diff line number Diff line change 134134
135135# 环境变量(可选,用于覆盖配置文件)
136136# export PROMETHEUS_ADDRESS="http://localhost:9090"
137- # export ALERT_WEBHOOK_URL="http://alert-module:8080/v1/integrations/prometheus/alerts "
137+ # export ALERT_WEBHOOK_URL="http://alert-module:8080/v1/integrations/alertmanager/webhook "
138138# export ALERT_POLLING_INTERVAL="10s"
139139# export SERVER_BIND_ADDR="0.0.0.0:9999"
140140
Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ Group=qboxserver
296296WorkingDirectory=$DEPLOY_DIR
297297# 可选:通过环境变量覆盖配置
298298#Environment="PROMETHEUS_ADDRESS=http://localhost:9090"
299- #Environment="ALERT_WEBHOOK_URL=http://alert-module:8080/v1/integrations/prometheus/alerts "
299+ #Environment="ALERT_WEBHOOK_URL=http://alert-module:8080/v1/integrations/alertmanager/webhook "
300300#Environment="ALERT_POLLING_INTERVAL=10s"
301301#Environment="SERVER_BIND_ADDR=0.0.0.0:9999"
302302ExecStart=$DEPLOY_DIR /bin/prometheus_adapter
You can’t perform that action at this time.
0 commit comments