Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions lib/sentry/interfaces.ex
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,56 @@ defmodule Sentry.Interfaces do
:stacktrace
]
end

defmodule Span do
@moduledoc """
The struct for a tracing **span**.

See <https://develop.sentry.dev/sdk/event-payloads/span>.
"""

@moduledoc since: "11.0.0"

@typedoc since: "11.0.0"
@type t() :: %__MODULE__{
start_timestamp: String.t() | number(),
timestamp: String.t() | number(),
span_id: String.t(),
parent_span_id: String.t() | nil,
description: String.t(),
tags: map(),
trace_id: String.t() | nil,
op: String.t(),
spans: [t()],
status: String.t(),
data: map(),
origin: String.t(),
measurements: %{
optional(String.t()) => %{required(:value) => term(), optional(:unit) => String.t()}
},

# Attributes that are only for "transactions", which are basically the root
# span of a trace. https://develop.sentry.dev/sdk/event-payloads/transaction/
event_id: String.t() | nil,
transaction_info: %{source: :custom | :url | :route | :view | :component | :task}
}

defstruct [
:event_id,
:description,
:tags,
:parent_span_id,
:trace_id,
:op,
:span_id,
:start_timestamp,
:timestamp,
:spans,
:measurements,
:transaction_info,
:status,
:data,
:origin
]
end
end