Skip to content

Commit

Permalink
[manager] bugfix: fix multiple monitorId and monitorName tags when im… (
Browse files Browse the repository at this point in the history
  • Loading branch information
l646505418 authored May 25, 2023
1 parent 64ba484 commit cf32ea8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.dromara.hertzbeat.common.constants.CommonConstants;
import org.dromara.hertzbeat.common.entity.manager.Monitor;
import org.dromara.hertzbeat.common.entity.manager.Param;
import org.dromara.hertzbeat.common.entity.manager.Tag;
Expand Down Expand Up @@ -124,7 +125,10 @@ private MonitorDto convert(ExportMonitorDTO exportMonitor) {
var monitor = new Monitor();
log.debug("exportMonitor.monitor{}", exportMonitor.monitor);
BeanUtils.copyProperties(exportMonitor.monitor, monitor);
monitor.setTags(tagService.listTag(new HashSet<>(exportMonitor.monitor.tags)));
monitor.setTags(tagService.listTag(new HashSet<>(exportMonitor.monitor.tags))
.stream().
filter(tag -> !(tag.getName().equals(CommonConstants.TAG_MONITOR_ID) || tag.getName().equals(CommonConstants.TAG_MONITOR_NAME)))
.collect(Collectors.toList()));
monitorDto.setMonitor(monitor);
monitorDto.setMetrics(exportMonitor.metrics);
monitorDto.setParams(exportMonitor.params.stream()
Expand Down

0 comments on commit cf32ea8

Please sign in to comment.