Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tracing): Restore OTel tracing support #2482

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cmd/relayproxy/api/server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api

import (
"context"
"errors"
"fmt"
"net/http"
Expand Down Expand Up @@ -117,6 +118,13 @@
defer func() { _ = s.monitoringEcho.Close() }()
}

// 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))

Check warning on line 124 in cmd/relayproxy/api/server.go

View check run for this annotation

Codecov / codecov/patch

cmd/relayproxy/api/server.go#L124

Added line #L124 was not covered by tests
// we can continue because otel is not mandatory to start the server
}

// starting the main application
if s.config.ListenPort == 0 {
s.config.ListenPort = 1031
Expand All @@ -127,7 +135,7 @@
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
Loading