feat: add stop after render and after render trace to mysql action
This commit is contained in:
parent
b2811f96b2
commit
120b35ac75
|
@ -104,10 +104,12 @@ on_query(
|
|||
#{channels := Channels, connector_state := ConnectorState}
|
||||
) when is_binary(Channel) ->
|
||||
ChannelConfig = maps:get(Channel, Channels),
|
||||
MergedState0 = maps:merge(ConnectorState, ChannelConfig),
|
||||
MergedState1 = MergedState0#{channel_id => Channel},
|
||||
Result = emqx_mysql:on_query(
|
||||
InstanceId,
|
||||
Request,
|
||||
maps:merge(ConnectorState, ChannelConfig)
|
||||
MergedState1
|
||||
),
|
||||
?tp(mysql_connector_on_query_return, #{instance_id => InstanceId, result => Result}),
|
||||
Result;
|
||||
|
@ -121,10 +123,12 @@ on_batch_query(
|
|||
) when is_binary(element(1, Req)) ->
|
||||
Channel = element(1, Req),
|
||||
ChannelConfig = maps:get(Channel, Channels),
|
||||
MergedState0 = maps:merge(ConnectorState, ChannelConfig),
|
||||
MergedState1 = MergedState0#{channel_id => Channel},
|
||||
Result = emqx_mysql:on_batch_query(
|
||||
InstanceId,
|
||||
BatchRequest,
|
||||
maps:merge(ConnectorState, ChannelConfig)
|
||||
MergedState1
|
||||
),
|
||||
?tp(mysql_connector_on_batch_query_return, #{instance_id => InstanceId, result => Result}),
|
||||
Result;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{application, emqx_mysql, [
|
||||
{description, "EMQX MySQL Database Connector"},
|
||||
{vsn, "0.1.8"},
|
||||
{vsn, "0.1.9"},
|
||||
{registered, []},
|
||||
{applications, [
|
||||
kernel,
|
||||
|
|
|
@ -498,6 +498,8 @@ on_sql_query(
|
|||
) ->
|
||||
LogMeta = #{connector => InstId, sql => SQLOrKey, state => State},
|
||||
?TRACE("QUERY", "mysql_connector_received", LogMeta),
|
||||
ChannelID = maps:get(channel_id, State, no_channel),
|
||||
emqx_trace:rendered_action_template(ChannelID, #{sql => SQLOrKey}),
|
||||
Worker = ecpool:get_client(PoolName),
|
||||
case ecpool_worker:client(Worker) of
|
||||
{ok, Conn} ->
|
||||
|
|
Loading…
Reference in New Issue