- 修复服务监控告警目标信息丢失的问题

This commit is contained in:
dushixiang committed 2025-12-18 18:46:08 +08:00
1 parent 6203b87e58
commit 76fa39b389
2 files changed
+3 -1

No files matched your search

+3
View File
@@ -171,6 +171,9 @@ func (h *MonitorHandler) GetAgentStatsByID(c echo.Context) error {
}
stats := h.metricService.GetMonitorAgentStats(id)
for i := range stats {
stats[i].Target = "" // 隐藏目标地址
}
return orz.Ok(c, stats)
}
-1
View File
@@ -632,7 +632,6 @@ func (s *MetricService) GetMonitorAgentStats(monitorID string) []protocol.Monito
// 转换为数组并填充 agent 名称
result := make([]protocol.MonitorData, 0, latestMetrics.Agents.Len())
for stat := range latestMetrics.Agents.Values() {
stat.Target = "" // 隐藏目标地址
stat.AgentName = agentNameMap[stat.AgentId] // 填充 agent 名称
result = append(result, *stat)
}