feat: propagate alert forwarding trace ids

This commit is contained in:
zxr
2026-07-21 17:19:39 +08:00
parent c263825cbc
commit 567dda70c0
3 changed files with 26 additions and 5 deletions

View File

@@ -53,9 +53,10 @@ func BuildReplayRawEventPayload(ev models.LogEvent) (RawEventIngestBody, error)
labels["resource_uid"] = resourceUID
labels["resource_category"] = category
labels["service_identity"] = identity
sourceEventKey := fmt.Sprintf("logs:replay:%d:%d", ev.ID, now.UnixNano())
return RawEventIngestBody{
SourceType: sourceType,
SourceEventKey: fmt.Sprintf("logs:replay:%d:%d", ev.ID, now.UnixNano()),
SourceEventKey: sourceEventKey,
State: "firing",
ResourceUID: resourceUID,
EventTime: now,
@@ -69,6 +70,7 @@ func BuildReplayRawEventPayload(ev models.LogEvent) (RawEventIngestBody, error)
},
ParseStatus: "parsed",
RawPayload: rawBytes,
TraceID: ensureAlertTraceID("", sourceEventKey),
}, nil
}