Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVCON-6293] add first timestamp #2737

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: code comment

}

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.