Skip to content

Commit 3fb3a0f

Browse files
committed
More dialyzer fixes
1 parent 6ae9171 commit 3fb3a0f

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

lib/sentry/envelope.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule Sentry.Envelope do
66

77
@type t() :: %__MODULE__{
88
event_id: UUID.t(),
9-
items: [Event.t() | Attachment.t() | CheckIn.t(), ...]
9+
items: [Event.t() | Attachment.t() | CheckIn.t() | Transaction.t(), ...]
1010
}
1111

1212
@enforce_keys [:event_id, :items]

lib/sentry/opentelemetry/span_processor.ex

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
defmodule Sentry.Opentelemetry.SpanProcessor do
22
@behaviour :otel_span_processor
33

4+
require Logger
5+
46
alias Sentry.{Span, Transaction, Opentelemetry.SpanStorage, Opentelemetry.SpanRecord}
57

68
@impl true
@@ -24,13 +26,26 @@ defmodule Sentry.Opentelemetry.SpanProcessor do
2426

2527
transaction = build_transaction(root_span, child_spans)
2628

27-
Sentry.send_transaction(transaction)
29+
result =
30+
case Sentry.send_transaction(transaction) do
31+
{:ok, _id} ->
32+
true
33+
34+
:ignored ->
35+
true
36+
37+
{:error, error} ->
38+
Logger.error("Failed to send transaction to Sentry: #{inspect(error)}")
39+
{:error, :invalid_span}
40+
end
2841

2942
SpanStorage.remove_span(span_record.span_id)
3043
SpanStorage.remove_child_spans(span_record.span_id)
31-
end
3244

33-
:ok
45+
result
46+
else
47+
true
48+
end
3449
end
3550

3651
@impl true

0 commit comments

Comments
 (0)