Skip to content

Commit

Permalink
Set OTEL span status to error when an exception is recorded for it (#…
Browse files Browse the repository at this point in the history
…2165)

Closes #2027.
  • Loading branch information
alco authored Dec 13, 2024
1 parent 008beed commit 4c730f6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ defmodule Electric.Telemetry.OpenTelemetry do
Exception.format_stacktrace(stacktrace)}
]

:otel_span.add_event(get_current_context(), "exception", semantic_attributes ++ attributes)
ctx = get_current_context()
:otel_span.add_event(ctx, "exception", semantic_attributes ++ attributes)
:otel_span.set_status(ctx, :error, message)
end

defp tracer, do: :opentelemetry.get_tracer()
Expand Down

0 comments on commit 4c730f6

Please sign in to comment.