ScoutApm.Error.ErrorData (scout_apm v2.0.0)

Copy Markdown

Internal representation of an error to be sent to Scout APM.

Summary

Functions

Creates an ErrorData struct from an Elixir exception.

Creates an ErrorData struct from telemetry exception data.

Converts the ErrorData to a map suitable for JSON encoding.

Types

t()

@type t() :: %ScoutApm.Error.ErrorData{
  context: map(),
  environment: map() | nil,
  exception_class: String.t(),
  host: String.t() | nil,
  message: String.t(),
  request_components: map() | nil,
  request_id: String.t() | nil,
  request_params: map() | nil,
  request_session: map() | nil,
  request_uri: String.t() | nil,
  revision_sha: String.t() | nil,
  trace: [String.t()]
}

Functions

from_exception(exception, opts \\ [])

@spec from_exception(
  Exception.t(),
  keyword()
) :: t()

Creates an ErrorData struct from an Elixir exception.

from_telemetry(atom, reason, stacktrace, opts)

@spec from_telemetry(
  :error | :throw | :exit,
  term(),
  Exception.stacktrace(),
  keyword()
) :: t() | nil

Creates an ErrorData struct from telemetry exception data.

to_map(error)

@spec to_map(t()) :: map()

Converts the ErrorData to a map suitable for JSON encoding.