diff --git a/cmd/relayproxy/api/server.go b/cmd/relayproxy/api/server.go index d0680fa3e19..ebce3b557ce 100644 --- a/cmd/relayproxy/api/server.go +++ b/cmd/relayproxy/api/server.go @@ -120,10 +120,12 @@ func (s *Server) Start() { } // start the OpenTelemetry tracing service - err := s.otelService.Init(context.Background(), *s.config) - if err != nil { - s.zapLog.Error("error while initializing Otel", zap.Error(err)) - // we can continue because otel is not mandatory to start the server + if s.config.OpenTelemetryOtlpEndpoint != "" { + err := s.otelService.Init(context.Background(), *s.config) + if err != nil { + s.zapLog.Error("error while initializing Otel", zap.Error(err)) + // we can continue because otel is not mandatory to start the server + } } // starting the main application @@ -136,7 +138,7 @@ func (s *Server) Start() { zap.String("address", address), zap.String("version", s.config.Version)) - err = s.apiEcho.Start(address) + err := s.apiEcho.Start(address) if err != nil && !errors.Is(err, http.ErrServerClosed) { s.zapLog.Fatal("Error starting relay proxy", zap.Error(err)) }