From 9df10ca7e3dd8052182fa833e6821b5aec4a81f8 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Mon, 23 Sep 2024 09:47:06 +1000 Subject: [PATCH] fix: ftl dev crashes with OTEL enabled (#2767) fixes: #2766 --- frontend/cli/cmd_serve.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/cli/cmd_serve.go b/frontend/cli/cmd_serve.go index 54287d8344..fea7559c7e 100644 --- a/frontend/cli/cmd_serve.go +++ b/frontend/cli/cmd_serve.go @@ -89,17 +89,16 @@ func (s *serveCmd) run(ctx context.Context, projConfig projectconfig.Config, ini logger.Infof("Starting FTL with %d controller(s)", s.Controllers) + err := observability.Init(ctx, false, "", "ftl-serve", ftl.Version, s.ObservabilityConfig) + if err != nil { + return fmt.Errorf("observability init failed: %w", err) + } // Bring up the DB and DAL. dsn, err := s.setupDB(ctx, s.DatabaseImage) if err != nil { return err } - err = observability.Init(ctx, false, "", "ftl-serve", ftl.Version, s.ObservabilityConfig) - if err != nil { - return fmt.Errorf("observability init failed: %w", err) - } - wg, ctx := errgroup.WithContext(ctx) bindAllocator, err := bind.NewBindAllocator(s.Bind)