Elixir notifier for Errorgap. Configure via Application env, then call
Errorgap.notify/2 directly, attach Errorgap.Plug to your Phoenix
endpoint, or wire Errorgap.LoggerHandler into :logger for handler-style
capture of crash reports and high-severity logs.
Beyond exceptions, the SDK ships source-aware backtraces, nested causes,
breadcrumbs (add_breadcrumb/3), structured logs (log/3), and APM
transactions (notify_transaction/2).
Summary
Functions
Record a diagnostic breadcrumb attached to subsequent notices built in this
process as context.breadcrumbs.
Clear the current process's breadcrumbs.
The id of the transaction this process is running in, if any.
Block until all queued notices have been delivered. Use during graceful shutdown.
Deliver a structured log line at the given level with an optional source.
Report an exception or string error to Errorgap. Returns :ok when the
notice is queued or successfully delivered, {:error, reason} otherwise.
Deliver an APM transaction. Build one with Errorgap.Transaction.web/4 or
Errorgap.Transaction.job/3.
Run fun as part of a transaction: errors reported from this process
while it runs carry its id as context.transaction_id, so errorgap shows
the error a request actually raised on its trace.
Functions
Record a diagnostic breadcrumb attached to subsequent notices built in this
process as context.breadcrumbs.
@spec clear_breadcrumbs() :: :ok
Clear the current process's breadcrumbs.
@spec current_transaction_id() :: binary() | nil
The id of the transaction this process is running in, if any.
@spec flush(timeout()) :: :ok
Block until all queued notices have been delivered. Use during graceful shutdown.
@spec log(binary(), binary() | atom(), binary() | nil, keyword()) :: :ok | {:error, term()} | {:ok, map()}
Deliver a structured log line at the given level with an optional source.
@spec notify( Exception.t() | binary(), keyword() ) :: :ok | {:error, term()} | {:ok, map()}
Report an exception or string error to Errorgap. Returns :ok when the
notice is queued or successfully delivered, {:error, reason} otherwise.
Options include :stacktrace, :context, :environment, :session,
:params, :cause (an exception whose :cause chain is flattened into
context.causes), :breadcrumbs, and :sync.
Deliver an APM transaction. Build one with Errorgap.Transaction.web/4 or
Errorgap.Transaction.job/3.
Run fun as part of a transaction: errors reported from this process
while it runs carry its id as context.transaction_id, so errorgap shows
the error a request actually raised on its trace.
transaction = Errorgap.Transaction.web("GET", "/orders/{id}", "/orders/7")
result = Errorgap.with_transaction(transaction, fn -> handle(conn) end)
Errorgap.notify_transaction(Map.merge(transaction, %{"status_code" => 200}))