Spandex v2.4.0 Spandex View Source

The functions here call the corresponding functions on the configured adapter.

Link to this section Summary

Types

Used for Span and Trace IDs (type defined by adapters)

Unix timestamp in nanoseconds

Link to this section Types

Link to this type headers() View Source
headers() ::
  [{atom(), binary()}]
  | [{binary(), binary()}]
  | %{optional(binary()) => binary()}

Used for Span and Trace IDs (type defined by adapters)

Unix timestamp in nanoseconds

Link to this section Functions

Link to this function continue_trace(name, span_context, opts) View Source
continue_trace(String.t(), Spandex.SpanContext.t(), Keyword.t()) ::
  {:ok, Spandex.Trace.t()}
  | {:error, :disabled}
  | {:error, :trace_already_present}
  | {:error, [Optimal.error()]}
Link to this function continue_trace(name, trace_id, span_id, opts) View Source
continue_trace(String.t(), Spandex.id(), Spandex.id(), Keyword.t()) ::
  {:ok, Spandex.Trace.t()}
  | {:error, :disabled}
  | {:error, :trace_already_present}
  | {:error, [Optimal.error()]}
This function is deprecated. Use continue_trace/3 instead.
Link to this function continue_trace_from_span(name, span, opts) View Source
continue_trace_from_span(String.t(), Spandex.Span.t(), Spandex.Tracer.opts()) ::
  {:ok, Spandex.Trace.t()}
  | {:error, :disabled}
  | {:error, :trace_already_present}
  | {:error, [Optimal.error()]}
Link to this function current_context(opts) View Source
current_context(Spandex.Tracer.opts()) ::
  {:ok, Spandex.SpanContext.t()}
  | {:error, :disabled}
  | {:error, :no_span_context}
  | {:error, :no_trace_context}
  | {:error, [Optimal.error()]}
Link to this function current_span(opts) View Source
current_span(Spandex.Tracer.opts()) :: Spandex.Span.t() | nil
Link to this function current_span_id(opts) View Source
current_span_id(Spandex.Tracer.opts()) :: Spandex.id() | nil
Link to this function current_trace_id(opts) View Source
current_trace_id(Spandex.Tracer.opts()) :: Spandex.id() | nil
Link to this function distributed_context(conn, opts) View Source
distributed_context(Plug.Conn.t(), Spandex.Tracer.opts()) ::
  {:ok, Spandex.SpanContext.t()}
  | {:error, :disabled}
  | {:error, [Optimal.error()]}
Link to this function finish_span(opts) View Source
finish_span(Spandex.Tracer.opts()) ::
  {:ok, Spandex.Span.t()}
  | {:error, :disabled}
  | {:error, :no_trace_context}
  | {:error, :no_span_context}
  | {:error, [Optimal.error()]}
Link to this function finish_trace(opts) View Source
finish_trace(Spandex.Tracer.opts()) ::
  {:ok, Spandex.Trace.t()}
  | {:error, :disabled}
  | {:error, :no_trace_context}
  | {:error, [Optimal.error()]}
Link to this function inject_context(headers, span_context, opts) View Source
Link to this function span_error(exception, stacktrace, opts) View Source
span_error(Exception.t(), Enum.t(), Spandex.Tracer.opts()) ::
  {:ok, Spandex.Span.t()}
  | {:error, :disabled}
  | {:error, :no_trace_context}
  | {:error, :no_span_context}
  | {:error, [Optimal.error()]}
Link to this function start_span(name, opts) View Source
start_span(String.t(), Spandex.Tracer.opts()) ::
  {:ok, Spandex.Span.t()}
  | {:error, :disabled}
  | {:error, :no_trace_context}
  | {:error, [Optimal.error()]}
Link to this function start_trace(name, opts) View Source
start_trace(binary(), Spandex.Tracer.opts()) ::
  {:ok, Spandex.Trace.t()}
  | {:error, :disabled}
  | {:error, :trace_running}
  | {:error, [Optimal.error()]}
Link to this function update_all_spans(opts) View Source
update_all_spans(Spandex.Tracer.opts()) ::
  {:ok, Spandex.Trace.t()}
  | {:error, :disabled}
  | {:error, :no_trace_context}
  | {:error, [Optimal.error()]}
Link to this function update_span(opts, top? \\ false) View Source
update_span(Spandex.Tracer.opts(), boolean()) ::
  {:ok, Spandex.Span.t()}
  | {:error, :disabled}
  | {:error, :no_trace_context}
  | {:error, :no_span_context}
  | {:error, [Optimal.error()]}
Link to this function update_top_span(opts) View Source
update_top_span(Spandex.Tracer.opts()) ::
  {:ok, Spandex.Span.t()}
  | {:error, :disabled}
  | {:error, :no_trace_context}
  | {:error, [Optimal.error()]}