diff --git a/lib/open_telemetry_decorator.ex b/lib/open_telemetry_decorator.ex index 09438c6..6ccc1a4 100644 --- a/lib/open_telemetry_decorator.ex +++ b/lib/open_telemetry_decorator.ex @@ -82,6 +82,10 @@ defmodule OpenTelemetryDecorator do e -> O11y.record_exception(e) reraise e, __STACKTRACE__ + catch + class, reason -> + O11y.set_error("#{class}:#{reason}") + :erlang.raise(class, reason, __STACKTRACE__) after O11y.end_span(parent_span) end