Skip to content

Commit

Permalink
Expand telemetry description for job exceptions
Browse files Browse the repository at this point in the history
Closes #1210
  • Loading branch information
sorentwo committed Dec 30, 2024
1 parent 5fa5523 commit c826da3
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lib/oban/telemetry.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@ defmodule Oban.Telemetry do
* `:result` — the `perform/1` return value, always `nil` for an exception or crash
* `:state` — one of `:success`, `:failure`, `:cancelled`, `:discard` or `:snoozed`
For `:exception` events the metadata also includes details about what caused the failure. The
`:kind` value is determined by how an error occurred. Here are the possible kinds:
* `:error` — from an `{:error, error}` return value. Some Erlang functions may also throw an
`:error` tuple, which will be reported as `:error`.
* `:exit` — from a caught process exit
* `:throw` — from a caught value, this doesn't necessarily mean that an error occurred and the
error value is unpredictable
For `:exception` events the metadata also includes details about what caused the failure.
* `:kind` — describes how an error occurred. Here are the possible kinds:
- `:error` — from an `{:error, error}` return value. Some Erlang functions may also throw an
`:error` tuple, which will be reported as `:error`.
- `:exit` — from a caught process exit
- `:throw` — from a caught value, this doesn't necessarily mean that an error occurred and the
error value is unpredictable
* `:reason` — a raised exception, wrapped crash, or wrapped error that caused the job to fail.
Raised exceptions are passes as is, crashes are wrapped in an `Oban.CrashError`, timeouts in
`Oban.TimeoutError`, and all other errors are normalized into an `Oban.PerformError`.
* `:stacktrace` — the `t:Exception.stacktrace/0` for crashes or raised exceptions. Failures from
manual error returns won't contain any application code entries and may have an empty
stacktrace.
## Engine Events
Expand Down

0 comments on commit c826da3

Please sign in to comment.