Skip to content

Commit

Permalink
fixup! fixup! Add record_exception to Erlang
Browse files Browse the repository at this point in the history
  • Loading branch information
gugahoa committed Nov 29, 2020
1 parent 3b03145 commit 8bddf4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/opentelemetry_api/src/otel_span.erl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ add_events(_, _) ->
Stacktrace :: list(any()),
Attributes :: opentelemetry:attributes().
record_exception(SpanCtx, Class, Term, Stacktrace, Attributes) ->
ExceptionAttributes = [{<<"exception.type">>, list_to_binary(io_lib:format("~p:~p", [Class, Term]))},
{<<"exception.stacktrace">>, list_to_binary(io_lib:format("~p", [Stacktrace]))}],
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~p:~p", [Class, Term]))},
{<<"exception.stacktrace">>, iolist_to_binary(io_lib:format("~p", [Stacktrace]))}],
add_event(SpanCtx, <<"exception">>, ExceptionAttributes ++ Attributes).

-spec record_exception(SpanCtx, Class, Term, Message, Stacktrace, Attributes) -> boolean() when
Expand All @@ -126,8 +126,8 @@ record_exception(SpanCtx, Class, Term, Stacktrace, Attributes) ->
Stacktrace :: list(any()),
Attributes :: opentelemetry:attributes().
record_exception(SpanCtx, Class, Term, Message, Stacktrace, Attributes) ->
ExceptionAttributes = [{<<"exception.type">>, list_to_binary(io_lib:format("~p:~p", [Class, Term]))},
{<<"exception.stacktrace">>, list_to_binary(io_lib:format("~p", [Stacktrace]))},
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~p:~p", [Class, Term]))},
{<<"exception.stacktrace">>, iolist_to_binary(io_lib:format("~p", [Stacktrace]))},
{<<"exception.message">>, Message}],
add_event(SpanCtx, <<"exception">>, ExceptionAttributes ++ Attributes).

Expand Down

0 comments on commit 8bddf4a

Please sign in to comment.