File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ var rootCmd = &cobra.Command{
92
92
healthCheckPath := "/healthz"
93
93
94
94
http .HandleFunc (healthCheckPath , func (rw http.ResponseWriter , r * http.Request ) {
95
- ctx , span := tracing .Tracer ().Start (r .Context (), "healthcheck" )
95
+ ctx , span := tracing .HealthCheckTracer ().Start (r .Context (), "healthcheck" )
96
96
defer span .End ()
97
97
98
98
err := e .HealthCheck (ctx )
Original file line number Diff line number Diff line change @@ -171,6 +171,15 @@ func run(_ *cobra.Command, _ []string) int {
171
171
healthCheckPath := "/healthz"
172
172
173
173
http .HandleFunc (healthCheckPath , func (rw http.ResponseWriter , r * http.Request ) {
174
+ ctx , span := tracing .HealthCheckTracer ().Start (r .Context (), "healthcheck" )
175
+ defer span .End ()
176
+
177
+ err := e .HealthCheck (ctx )
178
+ if err != nil {
179
+ http .Error (rw , err .Error (), http .StatusInternalServerError )
180
+ return
181
+ }
182
+
174
183
if e .IsNATSConnected () {
175
184
fmt .Fprint (rw , "ok" )
176
185
} else {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ var rootCmd = &cobra.Command{
56
56
healthCheckPath := "/healthz"
57
57
58
58
http .HandleFunc (healthCheckPath , func (rw http.ResponseWriter , r * http.Request ) {
59
- ctx , span := tracing .Tracer ().Start (r .Context (), "healthcheck" )
59
+ ctx , span := tracing .HealthCheckTracer ().Start (r .Context (), "healthcheck" )
60
60
defer span .End ()
61
61
62
62
err := e .HealthCheck (ctx )
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ var rootCmd = &cobra.Command{
93
93
e .EngineConfig .HeartbeatOptions .HealthCheck = healthCheck
94
94
}
95
95
http .HandleFunc (healthCheckPath , func (rw http.ResponseWriter , r * http.Request ) {
96
- ctx , span := tracing .Tracer ().Start (r .Context (), "healthcheck" )
96
+ ctx , span := tracing .HealthCheckTracer ().Start (r .Context (), "healthcheck" )
97
97
defer span .End ()
98
98
99
99
err := healthCheck (ctx )
You can’t perform that action at this time.
0 commit comments