Skip to content

Commit c572daa

Browse files
authored
@timestamp handling from opsgenie#165 (#92)
1 parent 5814d29 commit c572daa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/kube/event.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type EnhancedEvent struct {
1212
corev1.Event `json:",inline"`
1313
ClusterName string `json:"clusterName"`
1414
InvolvedObject EnhancedObjectReference `json:"involvedObject"`
15+
Timestamp time.Time `json:"@timestamp"`
1516
}
1617

1718
// DeDot replaces all dots in the labels and annotations with underscores. This is required for example in the
@@ -47,6 +48,7 @@ type EnhancedObjectReference struct {
4748
// ToJSON does not return an error because we are %99 confident it is JSON serializable.
4849
// TODO(makin) Is it a bad practice? It's open to discussion.
4950
func (e *EnhancedEvent) ToJSON() []byte {
51+
e.Timestamp = e.FirstTimestamp.Time
5052
b, _ := json.Marshal(e)
5153
return b
5254
}

0 commit comments

Comments
 (0)