fix: make mysql action rendered trace include parameters
When doing non-batch inserts with the MySQL action, prepared statements are used. We therefore need to include the parameters to the prepared statement when tracing the rendered templates. Fixes: https://emqx.atlassian.net/browse/EMQX-12335
This commit is contained in:
parent
c72682d81b
commit
246bce85ec
|
@ -507,7 +507,13 @@ 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}),
|
||||
emqx_trace:rendered_action_template(
|
||||
ChannelID,
|
||||
#{
|
||||
sql_or_key => SQLOrKey,
|
||||
parameters => Params
|
||||
}
|
||||
),
|
||||
Worker = ecpool:get_client(PoolName),
|
||||
case ecpool_worker:client(Worker) of
|
||||
{ok, Conn} ->
|
||||
|
|
Loading…
Reference in New Issue