From 42563a0090c20c038dfc30db2a30d0be0e43d52d Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 15 Nov 2024 17:32:47 +1100 Subject: [PATCH] chore: minor grafana fix (#3403) --- frontend/cli/cmd_serve.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/cli/cmd_serve.go b/frontend/cli/cmd_serve.go index a2b515bae..4c55ce54e 100644 --- a/frontend/cli/cmd_serve.go +++ b/frontend/cli/cmd_serve.go @@ -121,11 +121,13 @@ func (s *serveCmd) run( if !s.DisableGrafana && !bool(s.ObservabilityConfig.ExportOTEL) { err := dev.SetupGrafana(ctx, s.GrafanaImage) if err != nil { - return fmt.Errorf("failed to setup grafana image: %w", err) + logger.Errorf(err, "Failed to setup grafana image") + } else { + logger.Infof("Grafana started at http://localhost:3000") + os.Setenv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4317") + os.Setenv("OTEL_METRIC_EXPORT_INTERVAL", "1000") + s.ObservabilityConfig.ExportOTEL = true } - os.Setenv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4317") - os.Setenv("OTEL_METRIC_EXPORT_INTERVAL", "1000") - s.ObservabilityConfig.ExportOTEL = true } err := observability.Init(ctx, false, "", "ftl-serve", ftl.Version, s.ObservabilityConfig) if err != nil {