Skip to content

Commit

Permalink
fix(s3 tracing): do not format records as IO data in aggregate mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kjellwinblad committed May 23, 2024
1 parent fb7688a commit 89b47e8
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions apps/emqx_bridge_s3/src/emqx_bridge_s3_connector.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand All @@ -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 ->
Expand Down

0 comments on commit 89b47e8

Please sign in to comment.