sentry v7.2.4 Sentry.Event

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

Configuration

  • :in_app_module_whitelist - 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

Link to this type

sentry_exception()

sentry_exception() :: %{type: String.t(), value: String.t(), module: any()}
Link to this type

t()

t() :: %Sentry.Event{
  breadcrumbs: list(),
  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

Link to this function

add_metadata(state)

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

args_from_stacktrace(arg1)

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.

Link to this function

create_event(opts)

create_event(keyword()) :: t()

Creates an Event struct out of context collected and options

Options

  • :exception - Sentry-formatted exception
  • :original_exception - Original exception
  • :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)

culprit_from_stacktrace(Exception.stacktrace()) :: String.t() | nil
Link to this function

do_put_source_context(frame, file, line_number)

do_put_source_context(map(), String.t(), integer()) :: map()
Link to this function

stacktrace_to_frames(stacktrace)

stacktrace_to_frames(Exception.stacktrace()) :: [map()]
Link to this function

transform_exception(exception, opts)

transform_exception(Exception.t(), keyword()) :: t()

Transforms an Exception to a Sentry event.

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