diff --git a/lib/sentry/interfaces.ex b/lib/sentry/interfaces.ex index 0855ad2c..3f406ee0 100644 --- a/lib/sentry/interfaces.ex +++ b/lib/sentry/interfaces.ex @@ -267,4 +267,56 @@ defmodule Sentry.Interfaces do :stacktrace ] end + + defmodule Span do + @moduledoc """ + The struct for a tracing **span**. + + See . + """ + + @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