Skip to content

Commit

Permalink
[DEVCON-6293] add first timestamp (#2737)
Browse files Browse the repository at this point in the history
  • Loading branch information
smonero authored Jul 18, 2023
1 parent 59a4e68 commit 1be8a25
Show file tree
Hide file tree
Showing 6 changed files with 462 additions and 408 deletions.
2 changes: 2 additions & 0 deletions api/k8s/v1/k8s.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,8 @@ message Event {

// last timestamp is the most recent time the event occurred (which can be different from the first time)
int64 last_timestamp_millis = 12;

int64 first_timestamp_millis = 13;
}

message ListEventsRequest {
Expand Down
808 changes: 410 additions & 398 deletions backend/api/k8s/v1/k8s.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions backend/api/k8s/v1/k8s.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions backend/service/k8s/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@ func ProtoForEvent(cluster string, k8sEvent *corev1.Event) *k8sapiv1.Event {
// See https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#ObjectMeta
// See also https://github.com/kubernetes/kubernetes/issues/90482 for a discussion on different timestamps.
return &k8sapiv1.Event{
Cluster: clusterName,
Namespace: k8sEvent.Namespace,
Name: k8sEvent.Name,
Reason: k8sEvent.Reason,
Description: k8sEvent.Message,
InvolvedObjectName: k8sEvent.InvolvedObject.Name,
Kind: protoForObjectKind(k8sEvent.InvolvedObject.Kind),
CreationTimeMillis: k8sEvent.GetObjectMeta().GetCreationTimestamp().UnixMilli(),
Type: k8sEvent.Type,
LastTimestampMillis: k8sEvent.LastTimestamp.UnixMilli(),
Cluster: clusterName,
Namespace: k8sEvent.Namespace,
Name: k8sEvent.Name,
Reason: k8sEvent.Reason,
Description: k8sEvent.Message,
InvolvedObjectName: k8sEvent.InvolvedObject.Name,
Kind: protoForObjectKind(k8sEvent.InvolvedObject.Kind),
CreationTimeMillis: k8sEvent.GetObjectMeta().GetCreationTimestamp().UnixMilli(),
Type: k8sEvent.Type,
LastTimestampMillis: k8sEvent.LastTimestamp.UnixMilli(),
FirstTimestampMillis: k8sEvent.FirstTimestamp.UnixMilli(),
}
}

Expand Down
6 changes: 6 additions & 0 deletions frontend/api/src/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions frontend/api/src/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1be8a25

Please sign in to comment.