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

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


The following commit(s) were added to refs/heads/master by this push:
     new 917c11f29 [bugfix] Fix docker container name unable to display problem 
(#2914)
917c11f29 is described below

commit 917c11f298cfa70724b5a317ed746cafe1c7c27f
Author: Jast <[email protected]>
AuthorDate: Sun Dec 29 11:45:51 2024 +0800

    [bugfix] Fix docker container name unable to display problem (#2914)
    
    Co-authored-by: tomsun28 <[email protected]>
---
 .../java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java
 
b/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java
index ad955caf1..9aae8cd6b 100644
--- 
a/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java
+++ 
b/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java
@@ -41,6 +41,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.stream.Collectors;
 import org.springframework.util.CollectionUtils;
 
@@ -288,6 +289,9 @@ public class MetricsCollect implements Runnable, 
Comparable<MetricsCollect> {
                         }
                     } catch (Exception e) {
                         log.info("[calculates execute warning] {}.", 
e.getMessage());
+                        value = 
Optional.ofNullable(fieldValueMap.get(expression.getSourceText()))
+                                        .map(String::valueOf)
+                                        .orElse(null);
                     }
                 } else {
                     // does not exist then map the alias value


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to