feat: propagate alert forwarding trace ids
This commit is contained in:
@@ -25,6 +25,7 @@ const (
|
||||
)
|
||||
|
||||
func enqueueAlertWithDB(db *gorm.DB, logEventID uint, body AlertReceiveBody) (uint, error) {
|
||||
body.TraceID = ensureAlertTraceID(body.TraceID, body.SourceEventKey)
|
||||
payload, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -193,11 +194,12 @@ func forwardRawEvent(body RawEventIngestBody) error {
|
||||
if len(body.RawPayload) == 0 {
|
||||
return fmt.Errorf("raw_payload 不能为空")
|
||||
}
|
||||
body.TraceID = ensureAlertTraceID(body.TraceID, body.SourceEventKey)
|
||||
raw, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := postAlertPayload(cfg, "/Alert/v1/raw-events/ingest", raw)
|
||||
result, err := postAlertPayload(cfg, "/Alert/v1/raw-events/ingest", raw, body.TraceID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user