diff --git a/pkg/apis/monitor/alertrecord.go b/pkg/apis/monitor/alertrecord.go index d44a942546..1e339c1b65 100644 --- a/pkg/apis/monitor/alertrecord.go +++ b/pkg/apis/monitor/alertrecord.go @@ -14,7 +14,11 @@ package monitor -import "yunion.io/x/onecloud/pkg/apis" +import ( + "time" + + "yunion.io/x/onecloud/pkg/apis" +) const ( SEND_STATE_OK = "ok" @@ -41,8 +45,9 @@ type AlertRecordDetails struct { apis.StatusStandaloneResourceDetails apis.ScopedResourceBaseInfo - ResNum int64 `json:"res_num"` - AlertName string `json:"alert_name"` + ResNum int64 `json:"res_num"` + AlertName string `json:"alert_name"` + TriggerTime time.Time } type AlertRecordCreateInput struct { diff --git a/pkg/monitor/models/alertrecord.go b/pkg/monitor/models/alertrecord.go index c122bbe1e2..e9bc8c19eb 100644 --- a/pkg/monitor/models/alertrecord.go +++ b/pkg/monitor/models/alertrecord.go @@ -247,6 +247,7 @@ func (record *SAlertRecord) GetMoreDetails(out monitor.AlertRecordDetails) (moni if commonAlert != nil { out.AlertName = commonAlert.GetName() } + out.TriggerTime = record.CreatedAt return out, nil }