fix(s3 tracing): do not format records as IO data in aggregate mode
This commit is contained in:
parent
fb7688ab94
commit
89b47e8ffc
|
@ -366,10 +366,7 @@ run_aggregated_upload(InstId, ChannelID, Records, #{aggreg_id := AggregId}) ->
|
||||||
Timestamp = erlang:system_time(second),
|
Timestamp = erlang:system_time(second),
|
||||||
emqx_trace:rendered_action_template(ChannelID, #{
|
emqx_trace:rendered_action_template(ChannelID, #{
|
||||||
mode => aggregated,
|
mode => aggregated,
|
||||||
records => #emqx_trace_format_func_data{
|
records => Records
|
||||||
function = fun render_records/1,
|
|
||||||
data = Records
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
case emqx_connector_aggregator:push_records(AggregId, Timestamp, Records) of
|
case emqx_connector_aggregator:push_records(AggregId, Timestamp, Records) of
|
||||||
ok ->
|
ok ->
|
||||||
|
@ -379,13 +376,6 @@ run_aggregated_upload(InstId, ChannelID, Records, #{aggreg_id := AggregId}) ->
|
||||||
{error, {unrecoverable_error, Reason}}
|
{error, {unrecoverable_error, Reason}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
render_records(Records) ->
|
|
||||||
try
|
|
||||||
[unicode:characters_to_binary(R) || R <- Records]
|
|
||||||
catch
|
|
||||||
_:_ -> Records
|
|
||||||
end.
|
|
||||||
|
|
||||||
map_error({socket_error, _} = Reason) ->
|
map_error({socket_error, _} = Reason) ->
|
||||||
{recoverable_error, Reason};
|
{recoverable_error, Reason};
|
||||||
map_error(Reason = {aws_error, Status, _, _Body}) when Status >= 500 ->
|
map_error(Reason = {aws_error, Status, _, _Body}) when Status >= 500 ->
|
||||||
|
|
Loading…
Reference in New Issue