From 9bc73691f629ab6c3080c504cdc9c1bbd4414960 Mon Sep 17 00:00:00 2001 From: Jack Sadanowicz Date: Sun, 28 Jul 2024 06:45:06 -0600 Subject: [PATCH] fix broken healhchecks (#31) --- oak.yml | 10 +++++----- .../com/sproutsocial/nsqauthj/NsqAuthJApplication.java | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/oak.yml b/oak.yml index e3110dc..42e843d 100644 --- a/oak.yml +++ b/oak.yml @@ -1,7 +1,7 @@ service_name: nsqauthj deploy_type: remote_jar pom_file: pom.xml -slack_channel: eng-dbre +slack_channel: eng-dbre-alerts build_target_path: target startup_wait_seconds: 10 hosts: @@ -14,14 +14,14 @@ hosts: up: set: type: http - exec: "http://localhost:8080/ping/pass?api_key=hyPhinCagCuksOk7" + exec: "http://localhost:8080/healthcheck/pass?api_key=hyPhinCagCuksOk7" check: type: http - exec: "http://localhost:8080/ping" + exec: "http://localhost:8080/healthcheck" down: set: type: http - exec: "http://localhost:8080/ping/fail?api_key=hyPhinCagCuksOk7" + exec: "http://localhost:8080/healthcheck/fail?api_key=hyPhinCagCuksOk7" check: type: http - exec: "http://localhost:8080/ping" + exec: "http://localhost:8080/healthcheck" diff --git a/src/main/java/com/sproutsocial/nsqauthj/NsqAuthJApplication.java b/src/main/java/com/sproutsocial/nsqauthj/NsqAuthJApplication.java index 523c889..5a63673 100644 --- a/src/main/java/com/sproutsocial/nsqauthj/NsqAuthJApplication.java +++ b/src/main/java/com/sproutsocial/nsqauthj/NsqAuthJApplication.java @@ -5,6 +5,7 @@ import com.sproutsocial.configuration.dropwizard.DropwizardConfigCommonsFactoryFactory; import com.sproutsocial.nsqauthj.guice.TokenValidatorModule; import com.sproutsocial.nsqauthj.resources.AuthResource; +import com.sproutsocial.platform.dropwizard.commons.healthcheck.HealthCheckResource; import io.dropwizard.Application; import io.dropwizard.health.conf.HealthConfiguration; import io.dropwizard.health.core.HealthCheckBundle; @@ -35,5 +36,6 @@ protected HealthConfiguration getHealthConfiguration(NsqAuthJConfiguration nsqAu public void run(NsqAuthJConfiguration config, Environment env) { Injector injector = Guice.createInjector(new TokenValidatorModule(config, env.metrics())); env.jersey().register(injector.getInstance(AuthResource.class)); + env.jersey().register(new HealthCheckResource("nsqauthj")); } } \ No newline at end of file