Skip to content

Commit bf64621

Browse files
committed
feat(alerts): add Timestamp field to AlertFields struct
- Introduced `Timestamp` field to store alert timestamps. - Updated initialization logic to handle the new field directly.
1 parent d27805e commit bf64621

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/alerts/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type IncidentDetail struct {
2424
}
2525

2626
type AlertFields struct {
27+
Timestamp string `json:"@timestamp"`
2728
Status int `json:"status"`
2829
StatusLabel string `json:"statusLabel"`
2930
StatusObservation string `json:"statusObservation"`
@@ -316,6 +317,7 @@ func newAlert(alert *plugins.Alert, parentId *string) error {
316317
}
317318

318319
a := AlertFields{
320+
Timestamp: alert.Timestamp,
319321
Status: 1,
320322
StatusLabel: "Automatic review",
321323
Severity: severityN,
@@ -332,7 +334,6 @@ func newAlert(alert *plugins.Alert, parentId *string) error {
332334
GroupedBy: alert.GroupBy,
333335
}
334336

335-
a.Timestamp = alert.Timestamp
336337
a.Id = alert.Id
337338
a.ParentId = alert.ParentId
338339
a.Name = alert.Name

0 commit comments

Comments
 (0)