Skip to content

Commit f67ad51

Browse files
authored
Fixes distinct health-check routs initialization in app root (#177)
1 parent ec0f7b1 commit f67ad51

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

apps/hellgate/src/hellgate.erl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ init([]) ->
5959

6060
get_api_child_spec(MachineHandlers, Opts) ->
6161
{ok, Ip} = inet:parse_address(genlib_app:env(?MODULE, ip, "::")),
62-
HealthRoutes = construct_health_routes(genlib_app:env(?MODULE, health_check, #{})),
62+
HealthRoutes =
63+
construct_health_routes(liveness, genlib_app:env(?MODULE, health_check_liveness, #{})) ++
64+
construct_health_routes(readiness, genlib_app:env(?MODULE, health_check_readiness, #{})),
6365
EventHandlerOpts = genlib_app:env(?MODULE, scoper_event_handler_options, #{}),
6466
PrometeusRoute = get_prometheus_route(),
6567
woody_server:child_spec(
@@ -81,8 +83,10 @@ get_api_child_spec(MachineHandlers, Opts) ->
8183
}
8284
).
8385

84-
construct_health_routes(Check) ->
85-
[erl_health_handle:get_route(enable_health_logging(Check))].
86+
construct_health_routes(liveness, Check) ->
87+
[erl_health_handle:get_liveness_route(enable_health_logging(Check))];
88+
construct_health_routes(readiness, Check) ->
89+
[erl_health_handle:get_readiness_route(enable_health_logging(Check))].
8690

8791
enable_health_logging(Check) ->
8892
EvHandler = {erl_health_event_handler, []},

config/sys.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
service => {erl_health, service, [<<"hellgate">>]}
6969
}},
7070
{health_check_readiness, #{
71-
dmt_client => {dmt_client, health_check, [<<"hellgate">>]},
71+
dmt_client => {dmt_client, health_check, []},
7272
progressor =>
7373
{progressor, health_check, [
7474
%% list of progressors namespaces for tests

0 commit comments

Comments
 (0)