Skip to content

Commit 7856ba8

Browse files
author
Gustavo Aguiar
committed
fixup! Add record_exception to Erlang
1 parent 60db22b commit 7856ba8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/opentelemetry_api/src/otel_span.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ add_events(_, _) ->
114114
Stacktrace :: list(any()),
115115
Attributes :: opentelemetry:attributes().
116116
record_exception(SpanCtx, Class, Term, Stacktrace, Attributes) ->
117-
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~0tp:~0tP", [Class, Term, 10], [{chars_limit, 50}]))},
118-
{<<"exception.stacktrace">>, iolist_to_binary(io_lib:format("~0tp", [Stacktrace, 10], [{chars_limit, 50}]))}],
117+
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~0tP:~0tP", [Class, Term, 10], [{chars_limit, 50}]))},
118+
{<<"exception.stacktrace">>, iolist_to_binary(io_lib:format("~0tP", [Stacktrace, 10], [{chars_limit, 50}]))}],
119119
add_event(SpanCtx, <<"exception">>, ExceptionAttributes ++ Attributes).
120120

121121
-spec record_exception(SpanCtx, Class, Term, Message, Stacktrace, Attributes) -> boolean() when
@@ -126,8 +126,8 @@ record_exception(SpanCtx, Class, Term, Stacktrace, Attributes) ->
126126
Stacktrace :: list(any()),
127127
Attributes :: opentelemetry:attributes().
128128
record_exception(SpanCtx, Class, Term, Message, Stacktrace, Attributes) ->
129-
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~0tp:~0tP", [Class, Term, 10], [{chars_limit, 50}]))},
130-
{<<"exception.stacktrace">>, iolist_to_binary(io_lib:format("~0tp", [Stacktrace, 10], [{chars_limit, 50}]))},
129+
ExceptionAttributes = [{<<"exception.type">>, iolist_to_binary(io_lib:format("~0tP:~0tP", [Class, Term, 10], [{chars_limit, 50}]))},
130+
{<<"exception.stacktrace">>, iolist_to_binary(io_lib:format("~0tP", [Stacktrace, 10], [{chars_limit, 50}]))},
131131
{<<"exception.message">>, Message}],
132132
add_event(SpanCtx, <<"exception">>, ExceptionAttributes ++ Attributes).
133133

0 commit comments

Comments
 (0)