File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
package api
2
2
3
3
import (
4
+ "context"
4
5
"errors"
5
6
"fmt"
6
7
"net/http"
@@ -117,6 +118,13 @@ func (s *Server) Start() {
117
118
defer func () { _ = s .monitoringEcho .Close () }()
118
119
}
119
120
121
+ // start the OpenTelemetry tracing service
122
+ err := s .otelService .Init (context .Background (), * s .config )
123
+ if err != nil {
124
+ s .zapLog .Error ("error while initializing Otel" , zap .Error (err ))
125
+ // we can continue because otel is not mandatory to start the server
126
+ }
127
+
120
128
// starting the main application
121
129
if s .config .ListenPort == 0 {
122
130
s .config .ListenPort = 1031
@@ -127,7 +135,7 @@ func (s *Server) Start() {
127
135
zap .String ("address" , address ),
128
136
zap .String ("version" , s .config .Version ))
129
137
130
- err : = s .apiEcho .Start (address )
138
+ err = s .apiEcho .Start (address )
131
139
if err != nil && ! errors .Is (err , http .ErrServerClosed ) {
132
140
s .zapLog .Fatal ("Error starting relay proxy" , zap .Error (err ))
133
141
}
You can’t perform that action at this time.
0 commit comments