fix(emqx_ee_connector): log reason for failure when starting influxdb connector
This commit is contained in:
parent
812a87841b
commit
603532dacd
|
@ -234,7 +234,7 @@ do_start_client(
|
||||||
) ->
|
) ->
|
||||||
case influxdb:start_client(ClientConfig) of
|
case influxdb:start_client(ClientConfig) of
|
||||||
{ok, Client} ->
|
{ok, Client} ->
|
||||||
case influxdb:is_alive(Client) of
|
case influxdb:is_alive(Client, true) of
|
||||||
true ->
|
true ->
|
||||||
State = #{
|
State = #{
|
||||||
client => Client,
|
client => Client,
|
||||||
|
@ -249,13 +249,13 @@ do_start_client(
|
||||||
state => redact_auth(State)
|
state => redact_auth(State)
|
||||||
}),
|
}),
|
||||||
{ok, State};
|
{ok, State};
|
||||||
false ->
|
{false, Reason} ->
|
||||||
?tp(influxdb_connector_start_failed, #{error => influxdb_client_not_alive}),
|
?tp(influxdb_connector_start_failed, #{error => influxdb_client_not_alive}),
|
||||||
?SLOG(warning, #{
|
?SLOG(warning, #{
|
||||||
msg => "starting influxdb connector failed",
|
msg => "starting influxdb connector failed - client is not alive",
|
||||||
connector => InstId,
|
connector => InstId,
|
||||||
client => redact_auth(Client),
|
client => redact_auth(Client),
|
||||||
reason => "client is not alive"
|
reason => Reason
|
||||||
}),
|
}),
|
||||||
%% no leak
|
%% no leak
|
||||||
_ = influxdb:stop_client(Client),
|
_ = influxdb:stop_client(Client),
|
||||||
|
|
Loading…
Reference in New Issue