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

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 3e6712b70 [Improve] Add agent settings for lark alarm. (#2363)
3e6712b70 is described below

commit 3e6712b7092b8d774fd5ede471b921ee005244af
Author: chengyuan <[email protected]>
AuthorDate: Sat Feb 25 08:10:41 2023 +0800

    [Improve] Add agent settings for lark alarm. (#2363)
    
    * [Improve] Add agent settings for lark alarm.(#2364)
---
 .../core/service/alert/impl/LarkAlertNotifyServiceImpl.java        | 7 +++++--
 .../streampark-console-service/src/main/resources/application.yml  | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/LarkAlertNotifyServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/LarkAlertNotifyServiceImpl.java
index 74e232cdb..5bb63d40b 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/LarkAlertNotifyServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/LarkAlertNotifyServiceImpl.java
@@ -30,6 +30,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import freemarker.template.Template;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.net.util.Base64;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
@@ -53,6 +54,9 @@ public class LarkAlertNotifyServiceImpl implements 
AlertNotifyService {
   private final RestTemplate alertRestTemplate;
   private final ObjectMapper mapper;
 
+  @Value("${streampark.proxy.lark-url:https://open.feishu.cn}";)
+  private String larkProxyUrl;
+
   public LarkAlertNotifyServiceImpl(RestTemplate alertRestTemplate, 
ObjectMapper mapper) {
     this.alertRestTemplate = alertRestTemplate;
     this.mapper = mapper;
@@ -130,8 +134,7 @@ public class LarkAlertNotifyServiceImpl implements 
AlertNotifyService {
    * @return the webhook
    */
   private String getWebhook(AlertLarkParams params) {
-    String url =
-        String.format("https://open.feishu.cn/open-apis/bot/v2/hook/%s";, 
params.getToken());
+    String url = String.format(larkProxyUrl + "/open-apis/bot/v2/hook/%s", 
params.getToken());
     if (log.isDebugEnabled()) {
       log.debug("The alarm robot url of Lark is {}", url);
     }
diff --git 
a/streampark-console/streampark-console-service/src/main/resources/application.yml
 
b/streampark-console/streampark-console-service/src/main/resources/application.yml
index 441b50fd8..527a286e9 100644
--- 
a/streampark-console/streampark-console-service/src/main/resources/application.yml
+++ 
b/streampark-console/streampark-console-service/src/main/resources/application.yml
@@ -75,6 +75,8 @@ streampark:
   proxy:
     # knox process address 
https://cdpsit02.example.cn:8443/gateway/cdp-proxy/yarn
     yarn-url:
+    # lark alert proxy,default https://open.feishu.cn
+    lark-url:
   yarn:
       # default sample, or kerberos
     http-auth: sample

Reply via email to