mirror of
https://github.com/valitydev/kds.git
synced 2024-11-06 00:05:18 +00:00
Bump to rbkmoney/erlang-health@3a80bb4 (#13)
This commit is contained in:
parent
83fbfef475
commit
10778637e6
@ -34,7 +34,8 @@ stop() ->
|
||||
-spec init([]) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.
|
||||
init([]) ->
|
||||
{ok, IP} = inet:parse_address(application:get_env(kds, ip, "::")),
|
||||
HealthCheckers = genlib_app:env(?MODULE, health_checkers, []),
|
||||
HealthCheck = genlib_app:env(?MODULE, health_check, #{}),
|
||||
HealthRoute = erl_health_handle:get_route(enable_health_logging(HealthCheck)),
|
||||
KeyringManagementService = woody_server:child_spec(
|
||||
kds_thrift_management_service_sup,
|
||||
#{
|
||||
@ -47,7 +48,7 @@ init([]) ->
|
||||
transport_opts => genlib_app:env(?MODULE, management_transport_opts, #{}),
|
||||
protocol_opts => genlib_app:env(?MODULE, protocol_opts, #{}),
|
||||
shutdown_timeout => genlib_app:env(?MODULE, shutdown_timeout, 0),
|
||||
additional_routes => [erl_health_handle:get_route(HealthCheckers)]
|
||||
additional_routes => [HealthRoute]
|
||||
}
|
||||
),
|
||||
KeyringStorageService = woody_server:child_spec(
|
||||
@ -62,7 +63,7 @@ init([]) ->
|
||||
transport_opts => genlib_app:env(?MODULE, storage_transport_opts, #{}),
|
||||
protocol_opts => genlib_app:env(?MODULE, protocol_opts, #{}),
|
||||
shutdown_timeout => genlib_app:env(?MODULE, shutdown_timeout, 0),
|
||||
additional_routes => []
|
||||
additional_routes => [HealthRoute]
|
||||
}
|
||||
),
|
||||
KeyringSupervisor = #{
|
||||
@ -80,6 +81,11 @@ init([]) ->
|
||||
],
|
||||
{ok, {{one_for_one, 1, 5}, Procs}}.
|
||||
|
||||
-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).
|
||||
|
||||
|
||||
%%
|
||||
%% Application callbacks
|
||||
|
@ -28,11 +28,11 @@
|
||||
{keyring_storage_opts, #{
|
||||
keyring_path => "/var/lib/kds/keyring"
|
||||
}},
|
||||
{health_checkers, [
|
||||
{erl_health, disk , ["/", 99] },
|
||||
{erl_health, cg_memory, [99] },
|
||||
{erl_health, service , [<<"kds">>]}
|
||||
]},
|
||||
{health_check, #{
|
||||
disk => {erl_health, disk , ["/", 99] },
|
||||
memory => {erl_health, cg_memory, [99] },
|
||||
service => {erl_health, service , [<<"kds">>]}
|
||||
}},
|
||||
{keyring_rotation_lifetime, 60000},
|
||||
{keyring_initialize_lifetime, 180000},
|
||||
{keyring_rekeying_lifetime, 180000},
|
||||
|
@ -15,7 +15,7 @@
|
||||
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.6.0">>},2},
|
||||
{<<"erl_health">>,
|
||||
{git,"https://github.com/rbkmoney/erlang-health.git",
|
||||
{ref,"2575c7b63d82a92de54d2d27e504413675e64811"}},
|
||||
{ref,"3a80bb43a93eb0e7a940d19912d9e35c2cbe91f9"}},
|
||||
0},
|
||||
{<<"folsom">>,
|
||||
{git,"git@github.com:folsom-project/folsom.git",
|
||||
|
Loading…
Reference in New Issue
Block a user