View Source Sentry.Event (sentry v8.1.0)

Provides an Event Struct as well as transformation of Logger entries into Sentry Events.

configuration

Configuration

  • :in_app_module_allow_list - Expects a list of modules that is used to distinguish among stacktrace frames that belong to your app and ones that are part of libraries or core Elixir. This is used to better display the significant part of stacktraces. The logic is greedy, so if your app's root module is MyApp and your setting is [MyApp], that module as well as any submodules like MyApp.Submodule would be considered part of your app. Defaults to [].
  • :report_deps - Flag for whether to include the loaded dependencies when reporting an error. Defaults to true.

Link to this section Summary

Functions

Builds a map from argument value list. For Sentry, typically the key in the map would be the name of the variable, but we don't have that available.

Creates an Event struct out of context collected and options

Transforms an Exception to a Sentry event.

Link to this section Types

@type sentry_exception() :: %{type: String.t(), value: String.t(), module: any()}
@type t() :: %Sentry.Event{
  breadcrumbs: list(),
  contexts: map(),
  culprit: String.t() | nil,
  environment: any(),
  event_id: String.t() | nil,
  event_source: any(),
  exception: [sentry_exception()],
  extra: map(),
  fingerprint: list(),
  level: String.t(),
  message: String.t() | nil,
  modules: map(),
  original_exception: Exception.t() | nil,
  platform: String.t(),
  release: any(),
  request: map(),
  server_name: any(),
  stacktrace: %{frames: [map()]},
  tags: map(),
  timestamp: String.t() | nil,
  user: map()
}

Link to this section Functions

@spec add_metadata(t()) :: t()
Link to this function

args_from_stacktrace(arg1)

View Source
@spec args_from_stacktrace(Exception.stacktrace()) :: map()

Builds a map from argument value list. For Sentry, typically the key in the map would be the name of the variable, but we don't have that available.

@spec create_event(keyword()) :: t()

Creates an Event struct out of context collected and options

options

Options

  • :exception - Sentry-structured exception
  • :original_exception - Original Elixir exception struct
  • :message - message
  • :stacktrace - a list of Exception.stacktrace()
  • :extra - map of extra context
  • :user - map of user context
  • :tags - map of tags context
  • :request - map of request context
  • :breadcrumbs - list of breadcrumbs
  • :event_source - the source of the event
  • :level - error level
  • :fingerprint - list of the fingerprint for grouping this event
Link to this function

culprit_from_stacktrace(list)

View Source
@spec culprit_from_stacktrace(Exception.stacktrace()) :: String.t() | nil
Link to this function

do_put_source_context(frame, file, line_number)

View Source
@spec do_put_source_context(map(), String.t(), integer()) :: map()
Link to this function

stacktrace_to_frames(stacktrace)

View Source
@spec stacktrace_to_frames(Exception.stacktrace()) :: [map()]
Link to this function

transform_exception(exception, opts)

View Source
@spec transform_exception(
  Exception.t(),
  keyword()
) :: t()

Transforms an Exception to a Sentry event.

options

Options

  • :stacktrace - a list of Exception.stacktrace()
  • :extra - map of extra context
  • :user - map of user context
  • :tags - map of tags context
  • :request - map of request context
  • :breadcrumbs - list of breadcrumbs
  • :level - error level
  • :fingerprint - list of the fingerprint for grouping this event