diff --git a/frontend/cli/cmd_serve.go b/frontend/cli/cmd_serve.go index 9b4c12eb9d..173afedab1 100644 --- a/frontend/cli/cmd_serve.go +++ b/frontend/cli/cmd_serve.go @@ -28,6 +28,7 @@ import ( "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/ftlv1connect" "github.com/TBD54566975/ftl/backend/provisioner" "github.com/TBD54566975/ftl/backend/provisioner/scaling/localscaling" + "github.com/TBD54566975/ftl/backend/timeline" "github.com/TBD54566975/ftl/internal/bind" "github.com/TBD54566975/ftl/internal/configuration" "github.com/TBD54566975/ftl/internal/configuration/manager" @@ -62,6 +63,7 @@ type serveCommonConfig struct { GrafanaImage string `help:"The container image to start for the automatic Grafana instance" default:"grafana/otel-lgtm" env:"FTL_GRAFANA_IMAGE" hidden:""` DisableGrafana bool `help:"Disable the automatic Grafana that is started if no telemetry collector is specified." default:"false"` Ingress ingress.Config `embed:"" prefix:"ingress-"` + Timeline timeline.Config `embed:"" prefix:"timeline-"` Recreate bool `help:"Recreate any stateful resources if they already exist." default:"false"` controller.CommonConfig provisioner.CommonProvisionerConfig @@ -302,6 +304,14 @@ func (s *serveCommonConfig) run( }) } + // Start Timeline + wg.Go(func() error { + err := timeline.Start(ctx, s.Timeline, schemaEventSourceFactory()) + if err != nil { + return fmt.Errorf("timeline failed: %w", err) + } + return nil + }) // Start Cron wg.Go(func() error { err := cron.Start(ctx, schemaEventSourceFactory(), verbClient) diff --git a/frontend/cli/main.go b/frontend/cli/main.go index 750d1663d2..d21c4d1804 100644 --- a/frontend/cli/main.go +++ b/frontend/cli/main.go @@ -20,6 +20,7 @@ import ( "github.com/TBD54566975/ftl" "github.com/TBD54566975/ftl/backend/controller/admin" provisionerconnect "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/provisioner/v1beta1/provisionerpbconnect" + "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/timeline/v1/timelinev1connect" "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/ftlv1connect" "github.com/TBD54566975/ftl/internal" _ "github.com/TBD54566975/ftl/internal/automaxprocs" // Set GOMAXPROCS to match Linux container CPU quota. @@ -39,6 +40,7 @@ type InteractiveCLI struct { Version kong.VersionFlag `help:"Show version."` Endpoint *url.URL `default:"http://127.0.0.1:8892" help:"FTL endpoint to bind/connect to." env:"FTL_ENDPOINT"` ProvisionerEndpoint *url.URL `help:"Provisioner endpoint." env:"FTL_PROVISIONER_ENDPOINT" default:"http://127.0.0.1:8893"` + TimelineEndpoint *url.URL `help:"Timeline endpoint." env:"FTL_TIMELINE_ENDPOINT" default:"http://127.0.0.1:8894"` Ping pingCmd `cmd:"" help:"Ping the FTL cluster."` Status statusCmd `cmd:"" help:"Show FTL status."` @@ -231,6 +233,10 @@ func makeBindContext(logger *log.Logger, cancel context.CancelFunc) terminal.Kon ctx = rpc.ContextWithClient(ctx, provisionerServiceClient) kctx.BindTo(provisionerServiceClient, (*provisionerconnect.ProvisionerServiceClient)(nil)) + timelineServiceClient := rpc.Dial(timelinev1connect.NewTimelineServiceClient, cli.TimelineEndpoint.String(), log.Error) + ctx = rpc.ContextWithClient(ctx, timelineServiceClient) + kctx.BindTo(timelineServiceClient, (*timelinev1connect.TimelineServiceClient)(nil)) + err = kctx.BindToProvider(func() (*providers.Registry[configuration.Configuration], error) { return providers.NewDefaultConfigRegistry(), nil })