Appsignal.Tracer (AppSignal v2.1.10) View Source

Link to this section Summary

Functions

Closes a span and deregisters it.

Closes a span and deregisters it. Takes an options list, which currently only accepts a List with an :end_time integer.

Creates a new root span.

Creates a new child span.

Creates a new span, with an optional parent or pid.

Returns the current span in the current process.

Returns the current span in the passed pid's process.

Removes the process' spans from the registry.

Ignores the current process.

Finds the span in the registry table.

Returns the root span in the current process.

Returns the root span in the passed pid's process.

Link to this section Types

Specs

option() :: {:pid, pid()} | {:start_time, integer()}

Specs

options() :: [option()]

Link to this section Functions

Specs

close_span(Appsignal.Span.t() | nil) :: :ok | nil

Closes a span and deregisters it.

Example

Appsignal.Tracer.current_span()
|> Appsignal.Tracer.close_span()
Link to this function

close_span(span, options)

View Source

Specs

close_span(Appsignal.Span.t() | nil, list()) :: :ok | nil

Closes a span and deregisters it. Takes an options list, which currently only accepts a List with an :end_time integer.

Example

Appsignal.Tracer.current_span()
|> Appsignal.Tracer.close_span(end_time: :os.system_time())

Specs

create_span(String.t()) :: Appsignal.Span.t() | nil

Creates a new root span.

Example

Appsignal.Tracer.create_span("http_request")
Link to this function

create_span(namespace, parent)

View Source

Specs

create_span(String.t(), Appsignal.Span.t() | nil) :: Appsignal.Span.t() | nil

Creates a new child span.

Example

parent = Appsignal.Tracer.current_span()

Appsignal.Tracer.create_span("http_request", parent)
Link to this function

create_span(namespace, parent, options)

View Source

Specs

create_span(String.t(), Appsignal.Span.t() | nil, options()) ::
  Appsignal.Span.t() | nil

Creates a new span, with an optional parent or pid.

Example

parent = Appsignal.Tracer.current_span()

Appsignal.Tracer.create_span("http_request", parent, [start_time: :os.system_time(), pid: self()])

Specs

current_span() :: Appsignal.Span.t() | nil

Returns the current span in the current process.

Specs

current_span(pid()) :: Appsignal.Span.t() | nil

Returns the current span in the passed pid's process.

Specs

delete(pid()) :: :ok

Removes the process' spans from the registry.

Specs

ignore() :: :ok | nil

Ignores the current process.

Specs

lookup(pid()) :: list()

Finds the span in the registry table.

Specs

root_span() :: Appsignal.Span.t() | nil

Returns the root span in the current process.

Specs

root_span(pid()) :: Appsignal.Span.t() | nil

Returns the root span in the passed pid's process.