OiO.lk Blog java Why is one service not handling /actuator/health, but another very similar service is?
java

Why is one service not handling /actuator/health, but another very similar service is?


Our team maintains a large number of architecturally similar SpringBoot services. They are mostly using SpringBoot 3.2.5. We configure the "health" actuator for use within our Kubernetes cluster, to verify that the service is still healthy.

I’m looking at one service that for some reason is getting a 404 error when attempting to reach that url. I’m comparing it to another service that does not have this problem. I have breakpoints set in the custom application code that internally calls the actuator, and also in the code in org.springframework.boot.actuate.health.HealthEndpointWebExtension.health() that handles this actuator call. I can run the Application class in the "good" service, and it correctly goes into the handler. I can run the Application class in the "bad" service, and it fails with a 404 on that call.

I have examined the application.properties files in both services. I’ve sorted both of them and focused on all the properties beginning with management. They are identical.

I’ve printed out the contents of the fat jar for each service, focusing on the files in BOOT-INF/lib. They are definitely different, because they do slightly different things, but none of the differences are in Spring artifacts.

I’ve verified with breakpoints that the `/actuator/health’ call to the bad service does get into the service, but it doesn’t find a handler for it and returns a 404.

I’ve stepped into org.springframework.boot.actuate.autoconfigure.health.HealthEndpointWebExtensionConfiguration.getHealthEndpoint(WebEndpointsSupplier) with both the good and bad service, and I can see the health endpoint in the list, and it does find it. I don’t see any obvious differences in the data between the bad service and the good service.

What else can I look at to determine why this handler is either not properly registered, or somehow registered with the wrong path info?



You need to sign in to view this answers

Exit mobile version