You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@hertzbeat.apache.org by go...@apache.org on 2025/02/08 09:39:41 UTC

(hertzbeat) branch bugfix-some created (now 4db87484a6)

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

gongchao pushed a change to branch bugfix-some
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


      at 4db87484a6 [bugfix] fix singleton not support remove, search id error, audio mp4 fetch 401

This branch includes the following new commits:

     new 4db87484a6 [bugfix] fix singleton not support remove, search id error, audio mp4 fetch 401

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


(hertzbeat) 01/01: [bugfix] fix singleton not support remove, search id error, audio mp4 fetch 401

Posted by go...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4db87484a607bd32cbf6c78b580d0db6f5ffeae4
Author: tomsun28 <to...@outlook.com>
AuthorDate: Sat Feb 8 17:39:19 2025 +0800

    [bugfix] fix singleton not support remove, search id error, audio mp4 fetch 401
    
    Signed-off-by: tomsun28 <to...@outlook.com>
---
 .../java/org/apache/hertzbeat/alert/reduce/AlarmGroupReduce.java    | 4 ++--
 .../apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java   | 6 ++++--
 hertzbeat-manager/src/main/resources/sureness.yml                   | 1 +
 script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml       | 2 ++
 script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml    | 2 ++
 .../hertzbeat-mysql-victoria-metrics/conf/sureness.yml              | 2 ++
 .../hertzbeat-postgresql-victoria-metrics/conf/sureness.yml         | 2 ++
 script/sureness.yml                                                 | 2 ++
 8 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/hertzbeat-alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmGroupReduce.java b/hertzbeat-alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmGroupReduce.java
index 0507dfbe21..112c83291a 100644
--- a/hertzbeat-alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmGroupReduce.java
+++ b/hertzbeat-alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmGroupReduce.java
@@ -21,8 +21,8 @@ package org.apache.hertzbeat.alert.reduce;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -267,7 +267,7 @@ public class AlarmGroupReduce {
                 .groupLabels(alert.getLabels())
                 .commonLabels(alert.getLabels())
                 .commonAnnotations(alert.getAnnotations())
-                .alerts(Collections.singletonList(alert))
+                .alerts(new LinkedList<>(List.of(alert)))
                 .status(alert.getStatus())
                 .build();
 
diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java
index 06f45677a7..53b599b845 100644
--- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java
+++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java
@@ -567,10 +567,12 @@ public class MonitorServiceImpl implements MonitorService {
             if (StringUtils.isNotBlank(search)) {
                 Predicate predicateHost = criteriaBuilder.like(root.get("host"), "%" + search + "%");
                 Predicate predicateName = criteriaBuilder.like(criteriaBuilder.lower(root.get("name")), "%" + search.toLowerCase() + "%");
-                Predicate predicateId = criteriaBuilder.like(root.get("id"), "%" + search + "%");
+                if (StringUtils.isNumeric(search)){
+                    Predicate predicateId = criteriaBuilder.equal(root.get("id"), Long.parseLong(search));
+                    orList.add(predicateId);
+                }
                 orList.add(predicateHost);
                 orList.add(predicateName);
-                orList.add(predicateId);
             }
             if (StringUtils.isNotBlank(labels)) {
                 String[] labelAres = labels.split(",");
diff --git a/hertzbeat-manager/src/main/resources/sureness.yml b/hertzbeat-manager/src/main/resources/sureness.yml
index b2c394f46d..8cc3c203af 100644
--- a/hertzbeat-manager/src/main/resources/sureness.yml
+++ b/hertzbeat-manager/src/main/resources/sureness.yml
@@ -80,6 +80,7 @@ excludedResource:
   - /api/status/page/public/**===*
   # web ui resource
   - /===get
+  - /assets/**===get
   - /dashboard/**===get
   - /monitors/**===get
   - /alert/**===get
diff --git a/script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml b/script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml
index 9ebd316af1..8cc3c203af 100644
--- a/script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml
+++ b/script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml
@@ -72,6 +72,7 @@ resourceRole:
 # eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
 excludedResource:
   - /api/alerts/report/**===*
+  - /api/alert/sse/**===*
   - /api/account/auth/**===*
   - /api/i18n/**===get
   - /api/apps/hierarchy===get
@@ -79,6 +80,7 @@ excludedResource:
   - /api/status/page/public/**===*
   # web ui resource
   - /===get
+  - /assets/**===get
   - /dashboard/**===get
   - /monitors/**===get
   - /alert/**===get
diff --git a/script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml b/script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml
index 9ebd316af1..8cc3c203af 100644
--- a/script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml
+++ b/script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml
@@ -72,6 +72,7 @@ resourceRole:
 # eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
 excludedResource:
   - /api/alerts/report/**===*
+  - /api/alert/sse/**===*
   - /api/account/auth/**===*
   - /api/i18n/**===get
   - /api/apps/hierarchy===get
@@ -79,6 +80,7 @@ excludedResource:
   - /api/status/page/public/**===*
   # web ui resource
   - /===get
+  - /assets/**===get
   - /dashboard/**===get
   - /monitors/**===get
   - /alert/**===get
diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/sureness.yml b/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/sureness.yml
index 9ebd316af1..8cc3c203af 100644
--- a/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/sureness.yml
+++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/sureness.yml
@@ -72,6 +72,7 @@ resourceRole:
 # eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
 excludedResource:
   - /api/alerts/report/**===*
+  - /api/alert/sse/**===*
   - /api/account/auth/**===*
   - /api/i18n/**===get
   - /api/apps/hierarchy===get
@@ -79,6 +80,7 @@ excludedResource:
   - /api/status/page/public/**===*
   # web ui resource
   - /===get
+  - /assets/**===get
   - /dashboard/**===get
   - /monitors/**===get
   - /alert/**===get
diff --git a/script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/sureness.yml b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/sureness.yml
index 9ebd316af1..8cc3c203af 100644
--- a/script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/sureness.yml
+++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/sureness.yml
@@ -72,6 +72,7 @@ resourceRole:
 # eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
 excludedResource:
   - /api/alerts/report/**===*
+  - /api/alert/sse/**===*
   - /api/account/auth/**===*
   - /api/i18n/**===get
   - /api/apps/hierarchy===get
@@ -79,6 +80,7 @@ excludedResource:
   - /api/status/page/public/**===*
   # web ui resource
   - /===get
+  - /assets/**===get
   - /dashboard/**===get
   - /monitors/**===get
   - /alert/**===get
diff --git a/script/sureness.yml b/script/sureness.yml
index 9ebd316af1..8cc3c203af 100644
--- a/script/sureness.yml
+++ b/script/sureness.yml
@@ -72,6 +72,7 @@ resourceRole:
 # eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
 excludedResource:
   - /api/alerts/report/**===*
+  - /api/alert/sse/**===*
   - /api/account/auth/**===*
   - /api/i18n/**===get
   - /api/apps/hierarchy===get
@@ -79,6 +80,7 @@ excludedResource:
   - /api/status/page/public/**===*
   # web ui resource
   - /===get
+  - /assets/**===get
   - /dashboard/**===get
   - /monitors/**===get
   - /alert/**===get


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