Skip to content

Commit

Permalink
chore: Fix otel start (#2499)
Browse files Browse the repository at this point in the history
* fix: don't stary Otel when no configuration

* chore: scope test bench (#2495)

* Bump to 1.22.8 (#2491)
  • Loading branch information
thomaspoignant authored Oct 11, 2024
1 parent ed39a6e commit 465a97f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/relayproxy/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
}
Expand Down

0 comments on commit 465a97f

Please sign in to comment.