Karyon health check handler not updating Eureka Server

81 views
Skip to first unread message

PP

unread,
Nov 3, 2016, 5:18:29 PM11/3/16
to eureka_netflix
 

I have a healthcheck handler which checks the status of my application. However my application does not update the status of the app to Eureka. Eureka always shows the app as UP.

I have set:


com.netflix.karyon.unify.health.check.with.eureka=true
 com
.netflix.karyon.health.check.handler.classname=com.test.testcsf.simplesidecar.SimpleSidecarHealthCheckHandler
 com
.netflix.karyon.server.base.packages=com.test.testcsf.simplesidecar

My SimpleSidecarHealthCheckHandler code is:




 
import com.netflix.karyon.spi.HealthCheckHandler;

public class SimpleSidecarHealthCheckHandler implements HealthCheckHandler {
 
private static final Logger logger = LoggerFactory.getLogger(SimpleSidecarHealthCheckHandler.class);

 
/** */
 
@Inject
 
CheckManager checkManager;

 
@Override
 
public int getStatus() {
 logger
.debug("health check being called");

 
boolean passing = checkManager.allHealthChecksPassing();
 
//logger.error("ROHIT| Passing: "+ passing);
 
return passing ? 200 : 503;
 
}
}

checkManager is a class which keeps track of whether the service is down or not. When I print logs, I see that this function is not being called at all. Could someone guide me on what setting should I change ?

dl...@netflix.com

unread,
Nov 7, 2016, 8:42:10 PM11/7/16
to eureka_netflix
Hi,

I would recommend that you take a look at https://github.com/Netflix/runtime-health as a way of using healthchecks with eureka.

Thanks

PP

unread,
Nov 30, 2016, 5:15:21 PM11/30/16
to eureka_netflix
Thanks for linking me to runtime-health. I am not able to follow the example on how i should use this library.

Do I need to set
health.status.indicators.include=com.myproject.MyIndicator

and then implement MyIndicator similar to

MyHealthIndicator ?

If I do that, I get an error: The method inform(Health) in the type HealthIndicatorCallback is not applicable for the arguments (Health.Builder)
Reply all
Reply to author
Forward
0 new messages