fix(cassandra): format rendered trace in a better way
Fixes: https://emqx.atlassian.net/browse/EMQX-12393
This commit is contained in:
parent
9fd8e930be
commit
413ad60bdb
|
@ -12,6 +12,7 @@
|
||||||
-include_lib("emqx/include/logger.hrl").
|
-include_lib("emqx/include/logger.hrl").
|
||||||
-include_lib("hocon/include/hoconsc.hrl").
|
-include_lib("hocon/include/hoconsc.hrl").
|
||||||
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
|
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
|
||||||
|
-include_lib("emqx/include/emqx_trace.hrl").
|
||||||
|
|
||||||
%% schema
|
%% schema
|
||||||
-export([roots/0, fields/1, desc/1, namespace/0]).
|
-export([roots/0, fields/1, desc/1, namespace/0]).
|
||||||
|
@ -273,11 +274,14 @@ do_batch_query(InstId, Requests, Async, #{pool_name := PoolName} = State) ->
|
||||||
_ -> none
|
_ -> none
|
||||||
end,
|
end,
|
||||||
emqx_trace:rendered_action_template(ChannelID, #{
|
emqx_trace:rendered_action_template(ChannelID, #{
|
||||||
cqls => CQLs
|
cqls => #emqx_trace_format_func_data{data = CQLs, function = fun trace_format_cql_tuples/1}
|
||||||
}),
|
}),
|
||||||
Res = exec_cql_batch_query(InstId, PoolName, Async, CQLs),
|
Res = exec_cql_batch_query(InstId, PoolName, Async, CQLs),
|
||||||
handle_result(Res).
|
handle_result(Res).
|
||||||
|
|
||||||
|
trace_format_cql_tuples(Tuples) ->
|
||||||
|
[CQL || {_, CQL} <- Tuples].
|
||||||
|
|
||||||
parse_request_to_cql({query, CQL}) ->
|
parse_request_to_cql({query, CQL}) ->
|
||||||
{query, CQL, #{}};
|
{query, CQL, #{}};
|
||||||
parse_request_to_cql({query, CQL, Params}) ->
|
parse_request_to_cql({query, CQL, Params}) ->
|
||||||
|
|
Loading…
Reference in New Issue