fix(obs): 对齐无兼容层与健康/UV 权威语义

Agent 本地旧观测缓冲直接删除并运行重建;设计文档去掉兼容期表述。
健康当前态以 PG status/message 为准,CH 仅存 status 与连接时序;
Zone 曲线标明分桶 UV,顶部为整窗独立访客。
This commit is contained in:
ryan
2026-07-18 12:09:27 +08:00
parent 802d516f5b
commit 55f8c9a527
8 changed files with 285 additions and 107 deletions
+14
View File
@@ -64,6 +64,20 @@ func normalizeNodePayload(payload NodePayload) NodePayload {
payload.LastError = truncateForDatabase(payload.LastError, maxDatabaseTextLength)
payload.OpenrestyStatus = normalizeOpenrestyStatus(payload.OpenrestyStatus)
payload.OpenrestyMessage = truncateForDatabase(payload.OpenrestyMessage, maxDatabaseTextLength)
// Align L2 edge_health with top-level status/message (PG is latest-state authority).
if payload.EdgeHealth != nil {
if s := strings.TrimSpace(payload.EdgeHealth.Status); s != "" {
if payload.OpenrestyStatus == "" || payload.OpenrestyStatus == openrestyStatusUnknown {
payload.OpenrestyStatus = normalizeOpenrestyStatus(s)
}
}
if m := strings.TrimSpace(payload.EdgeHealth.Message); m != "" && payload.OpenrestyMessage == "" {
payload.OpenrestyMessage = truncateForDatabase(m, maxDatabaseTextLength)
}
// CH series status must match the same authority as PG after normalize.
payload.EdgeHealth.Status = payload.OpenrestyStatus
payload.EdgeHealth.Message = payload.OpenrestyMessage
}
return payload
}