Skip to content

Commit

Permalink
feat: add filters and ordering to timeline service (#3635)
Browse files Browse the repository at this point in the history
closes #3628
- Proto filters copied from `console.pb`
- In-memory filters based on `backend/controller/timeline/query.go`

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
matt2e and github-actions[bot] authored Dec 5, 2024
1 parent 5cc5c18 commit 62325ba
Show file tree
Hide file tree
Showing 9 changed files with 2,059 additions and 304 deletions.
1,190 changes: 1,009 additions & 181 deletions backend/protos/xyz/block/ftl/timeline/v1/timeline.pb.go

Large diffs are not rendered by default.

74 changes: 70 additions & 4 deletions backend/protos/xyz/block/ftl/timeline/v1/timeline.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,83 @@ syntax = "proto3";

package xyz.block.ftl.timeline.v1;

import "google/protobuf/timestamp.proto";
import "xyz/block/ftl/timeline/v1/event.proto";
import "xyz/block/ftl/v1/ftl.proto";

option go_package = "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/timeline/v1;timelinev1";
option java_multiple_files = true;

message GetTimelineRequest {
string deployment_key = 1;
optional int64 since_id = 2;
optional int32 limit = 3;
repeated timeline.v1.EventType event_types = 4;
// Limit the number of events returned.
message LimitFilter {
int32 limit = 1;
}
// Filters events by log level.
message LogLevelFilter {
timeline.v1.LogLevel log_level = 1;
}
// Filters events by deployment key.
message DeploymentFilter {
repeated string deployments = 1;
}
// Filters events by request key.
message RequestFilter {
repeated string requests = 1;
}
// Filters events by event type.
message EventTypeFilter {
repeated timeline.v1.EventType event_types = 1;
}
// Filters events by time.
//
// Either end of the time range can be omitted to indicate no bound.
message TimeFilter {
optional google.protobuf.Timestamp older_than = 1;
optional google.protobuf.Timestamp newer_than = 2;
}
// Filters events by ID.
//
// Either end of the ID range can be omitted to indicate no bound.
message IDFilter {
optional int64 lower_than = 1;
optional int64 higher_than = 2;
}
// Filters events by call.
message CallFilter {
string dest_module = 1;
optional string dest_verb = 2;
optional string source_module = 3;
}
message ModuleFilter {
string module = 1;
optional string verb = 2;
}

enum Order {
ORDER_UNSPECIFIED = 0;
ORDER_ASC = 1;
ORDER_DESC = 2;
}

message Filter {
// These map 1:1 with filters in backend/timeline/filters.go
oneof filter {
LimitFilter limit = 1;
LogLevelFilter log_level = 2;
DeploymentFilter deployments = 3;
RequestFilter requests = 4;
EventTypeFilter event_types = 5;
TimeFilter time = 6;
IDFilter id = 7;
CallFilter call = 8;
ModuleFilter module = 9;
}
}

repeated Filter filters = 1;
int32 limit = 2;
Order order = 3;
}

message GetTimelineResponse {
Expand Down
68 changes: 0 additions & 68 deletions backend/timeline/events.go

This file was deleted.

Loading

0 comments on commit 62325ba

Please sign in to comment.