fix(s3 tracing): do not format records as IO data in aggregate mode

This commit is contained in:
Kjell Winblad 2024-05-23 12:41:30 +02:00
parent fb7688ab94
commit 89b47e8ffc
1 changed files with 1 additions and 11 deletions

View File

@ -366,10 +366,7 @@ run_aggregated_upload(InstId, ChannelID, Records, #{aggreg_id := AggregId}) ->
Timestamp = erlang:system_time(second),
emqx_trace:rendered_action_template(ChannelID, #{
mode => aggregated,
records => #emqx_trace_format_func_data{
function = fun render_records/1,
data = Records
}
records => Records
}),
case emqx_connector_aggregator:push_records(AggregId, Timestamp, Records) of
ok ->
@ -379,13 +376,6 @@ run_aggregated_upload(InstId, ChannelID, Records, #{aggreg_id := AggregId}) ->
{error, {unrecoverable_error, Reason}}
end.
render_records(Records) ->
try
[unicode:characters_to_binary(R) || R <- Records]
catch
_:_ -> Records
end.
map_error({socket_error, _} = Reason) ->
{recoverable_error, Reason};
map_error(Reason = {aws_error, Status, _, _Body}) when Status >= 500 ->