Duansg commented on code in PR #4101:
URL: https://github.com/apache/hertzbeat/pull/4101#discussion_r3067725243
##########
hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java:
##########
@@ -382,22 +375,31 @@ public void modifyMonitor(Monitor monitor, List<Param>
params, String collector,
labelDao.saveAll(addLabels);
}
+ boolean isStatic =
CommonConstants.SCRAPE_STATIC.equals(monitor.getScrape())
+ || !StringUtils.hasText(monitor.getScrape());
+ if (!isStatic && !StringUtils.hasText(monitor.getInstance())) {
+ monitor.setInstance("unknown");
+ }
+
String instance = monitor.getInstance();
// The port field may be null
Param portParam = params.stream()
- .filter(param -> PARAM_FIELD_PORT.equals(param.getField()))
- .findFirst()
- .orElse(null);
+ .filter(param -> PARAM_FIELD_PORT.equals(param.getField()))
+ .findFirst()
+ .orElse(null);
String portWithMark = (Objects.isNull(portParam) ||
!StringUtils.hasText(portParam.getParamValue()))
- ? ""
- : SignConstants.DOUBLE_MARK + portParam.getParamValue();
+ ? ""
+ : SignConstants.DOUBLE_MARK + portParam.getParamValue();
+ if (IpDomainUtil.isHasPortWithMark(instance)){
Review Comment:
Please thoroughly test all page functions before determining whether there
is an issue here. And don’t just rely on AI assistance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]