Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter authored Feb 11, 2021
1 parent 7856ba8 commit 37f5559
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/opentelemetry_api/src/otel_span.erl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ add_events(_, _) ->
Stacktrace :: list(any()),
Attributes :: opentelemetry:attributes().
record_exception(SpanCtx, Class, Term, Stacktrace, Attributes) ->
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~0tP:~0tP", [Class, Term, 10], [{chars_limit, 50}]))},
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~0tP:~0tP", [Class, 10, Term, 10], [{chars_limit, 50}]))},
{<<"exception.stacktrace">>, iolist_to_binary(io_lib:format("~0tP", [Stacktrace, 10], [{chars_limit, 50}]))}],
add_event(SpanCtx, <<"exception">>, ExceptionAttributes ++ Attributes).

Expand All @@ -126,7 +126,7 @@ record_exception(SpanCtx, Class, Term, Stacktrace, Attributes) ->
Stacktrace :: list(any()),
Attributes :: opentelemetry:attributes().
record_exception(SpanCtx, Class, Term, Message, Stacktrace, Attributes) ->
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~0tP:~0tP", [Class, Term, 10], [{chars_limit, 50}]))},
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~0tP:~0tP", [Class, 10, Term, 10], [{chars_limit, 50}]))},
{<<"exception.stacktrace">>, iolist_to_binary(io_lib:format("~0tP", [Stacktrace, 10], [{chars_limit, 50}]))},
{<<"exception.message">>, Message}],
add_event(SpanCtx, <<"exception">>, ExceptionAttributes ++ Attributes).
Expand Down

0 comments on commit 37f5559

Please sign in to comment.