Skip to content

Commit 6bd995d

Browse files
Service Health Status in Endpoints Controller Logs (#4616)
* Service Health Status in Endpoints Controller Logs This PR includes the health status of the service being registered/updated by the endpoints controller. This helps in identifying the service health state transitions, which is currently not possible and impacts the ability to troubleshoot issues. * added changelog --------- Co-authored-by: Arnab Chatterjee <arnabkaycee@gmail.com>
1 parent 99767fe commit 6bd995d

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.changelog/4616.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:improvement
2+
control-plane: Shows the health status of the services being registered/updates by endpoints controller
3+
```

control-plane/connect-inject/controllers/endpoints/endpoints_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ func (r *Controller) registerServicesAndHealthCheck(apiClient *api.Client, pod c
303303

304304
// Register the service instance with Consul.
305305
r.Log.Info("registering service with Consul", "name", serviceRegistration.Service.Service,
306-
"id", serviceRegistration.Service.ID)
306+
"id", serviceRegistration.Service.ID, "health", healthStatus)
307307
_, err = apiClient.Catalog().Register(serviceRegistration, nil)
308308
if err != nil {
309309
r.Log.Error(err, "failed to register service", "name", serviceRegistration.Service.Service)
@@ -319,7 +319,7 @@ func (r *Controller) registerServicesAndHealthCheck(apiClient *api.Client, pod c
319319
}
320320

321321
// Register the proxy service instance with Consul.
322-
r.Log.Info("registering proxy service with Consul", "name", proxyServiceRegistration.Service.Service, "id", proxyServiceRegistration.Service.ID)
322+
r.Log.Info("registering proxy service with Consul", "name", proxyServiceRegistration.Service.Service, "id", proxyServiceRegistration.Service.ID, "health", healthStatus)
323323
_, err = apiClient.Catalog().Register(proxyServiceRegistration, nil)
324324
if err != nil {
325325
r.Log.Error(err, "failed to register proxy service", "name", proxyServiceRegistration.Service.Service)

0 commit comments

Comments
 (0)