mirror of
https://github.com/valitydev/dominant.git
synced 2024-11-06 02:25:17 +00:00
MSPF-499: Bump to rbkmoney/erlang-health@c190cb8 (#102)
Enable healthcheck logging
This commit is contained in:
parent
1e9172cf27
commit
b33bc9b89c
@ -21,7 +21,7 @@
|
||||
0},
|
||||
{<<"erl_health">>,
|
||||
{git,"https://github.com/rbkmoney/erlang-health.git",
|
||||
{ref,"2575c7b63d82a92de54d2d27e504413675e64811"}},
|
||||
{ref,"c190cb8de0359b933a27cd20ddc74180c0e5f5c4"}},
|
||||
0},
|
||||
{<<"genlib">>,
|
||||
{git,"https://github.com/rbkmoney/genlib.git",
|
||||
|
@ -24,7 +24,7 @@ stop(_State) ->
|
||||
|
||||
init(_) ->
|
||||
{ok, IP} = inet:parse_address(genlib_app:env(?MODULE, ip, "::")),
|
||||
HealthCheckers = genlib_app:env(?MODULE, health_checkers, []),
|
||||
HealthCheck = enable_health_logging(genlib_app:env(?MODULE, health_check, #{})),
|
||||
API = woody_server:child_spec(
|
||||
?MODULE,
|
||||
#{
|
||||
@ -34,7 +34,7 @@ init(_) ->
|
||||
event_handler => scoper_woody_event_handler,
|
||||
handlers => get_repository_handlers(),
|
||||
additional_routes => [
|
||||
erl_health_handle:get_route(HealthCheckers)
|
||||
erl_health_handle:get_route(HealthCheck)
|
||||
]
|
||||
}
|
||||
),
|
||||
@ -70,3 +70,10 @@ get_handler_spec(state_processor, Mod) ->
|
||||
{mg_proto_state_processing_thrift, 'Processor'},
|
||||
{dmt_api_automaton_handler, Mod}
|
||||
}}.
|
||||
|
||||
-spec enable_health_logging(erl_health:check()) ->
|
||||
erl_health:check().
|
||||
|
||||
enable_health_logging(Check) ->
|
||||
EvHandler = {erl_health_event_handler, []},
|
||||
maps:map(fun (_, V = {_, _, _}) -> #{runner => V, event_handler => EvHandler} end, Check).
|
||||
|
Loading…
Reference in New Issue
Block a user