Enable healthcheck logging
This commit is contained in:
Andrew Mayorov 2019-08-19 11:47:34 +03:00 committed by GitHub
parent a700a00854
commit 09b71d1ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -138,6 +138,16 @@ get_routes() ->
}
}}
],
HealthCheckers = genlib_app:env(?MODULE, health_checkers, []),
[erl_health_handle:get_route(HealthCheckers) |
Check = enable_health_logging(genlib_app:env(?MODULE, health_check, #{})),
[erl_health_handle:get_route(Check) |
machinery_mg_backend:get_routes(Handlers, RouteOpts)].
-spec enable_health_logging(erl_health:check()) ->
erl_health:check().
enable_health_logging(Check) ->
EvHandler = {erl_health_event_handler, []},
maps:map(
fun (_, Runner) -> #{runner => Runner, event_handler => EvHandler} end,
Check
).

View File

@ -14,7 +14,7 @@
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.6.0">>},2},
{<<"erl_health">>,
{git,"https://github.com/rbkmoney/erlang-health.git",
{ref,"2575c7b63d82a92de54d2d27e504413675e64811"}},
{ref,"c190cb8de0359b933a27cd20ddc74180c0e5f5c4"}},
0},
{<<"folsom">>,
{git,"git@github.com:folsom-project/folsom.git",