Skip to content

Commit 4397070

Browse files
committed
More dialyzer fixes
1 parent ead4cc3 commit 4397070

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

lib/sentry/envelope.ex

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

77
@type t() :: %__MODULE__{
88
event_id: UUID.t(),
9-
items: [Event.t() | Attachment.t() | CheckIn.t() | ClientReport.t(), ...]
9+
items: [
10+
Event.t() | Attachment.t() | CheckIn.t() | ClientReport.t() | Transaction.t()
11+
]
1012
}
1113

1214
@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)