![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
com.netflix.runtime:health-api
Advanced tools
Instance health is an important aspect of any cloud ready application. It is used for service discovery as well as bad instance termination. Through HealthCheck API an application can expose a REST endpoint for external monitoring to ping for health status or integrate with Eureka for service discovery registration based on instance health state. An instance can be in one of 2 lifecycle states: Healthy and Unhealthy.
The HealthCheck API is broken up into two abstractions to allow for maximum customization.
Runtime-health is published as the following artifacts:
# api package for libraries
com.netflix.runtime:health-api
# core implementation of runtime-health for applications and services
com.netflix.runtime:health-core
# guice integration with module HealthModule() and netflix archaius2 integration for configuration
com.netflix.runtime:health-guice
# integration with netflix eureka and bridging of health state and eureka status
com.netflix.runtime:health-integrations
@Path("/health")
public class HealthCheckResource {
@Inject
public HealthCheckResource(HealthCheckAggregator healthCheck) {
this.healthCheck = healthCheck;
}
@GET
public HealthCheckStatus doCheck() {
return healthCheck.check().get();
}
}
To create a custom health indicator simply implement HealthIndicator, inject any objects that are needed to determine the health state, and implement you logic in check(). Note that check returns a future so that the healthcheck system can implement a timeout. The check() implementation is therefore expected to be well behaved and NOT block.
public class MyHealthIndicator implements HealthIndicator {
@Inject
public MyHealthIndicator(MyService service) {
this.service = service;
}
@Override
public void check(HealthIndicatorCallback healthCallback) {
if (service.getErrorRate() > 0.1) {
healthCallback.inform(Health.unhealthy().withDetails("errorRate", service.getErrorRate()));
}
else {
healthCallback.inform(Health.healthy());
}
}
}
To register a HealthIndicator simply provide it when installing HealthModule. It will automatically be picked up by the default HealthCheckAggregator
InjectorBuilder.fromModules(new HealthModule() {
protected void configureHealth() {
bindAdditionalHealthIndicator().to(MyHealthIndicator.class);
bindAdditionalHealthIndicator().to(AnotherHealthIndicator.class); //e.g. if you have a second indicator defined
}
}).createInjector()
See health-integrations for additional integrations (e.g. with eureka)
FAQs
health-api
We found that com.netflix.runtime:health-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.