Telemetry is Baton's primary integration surface. The PubSub events and LiveView dashboard are optional layers on top; everything observable is also emitted as telemetry, so you can integrate without Phoenix.
Events
[:baton, :step, <state>]
Emitted on every step transition. <state> is one of :executing,
:completed, :retryable, :discarded, :cancelled, :snoozed.
Measurements: %{count: 1}
Metadata: %{workflow_id, workflow_label, step_name, worker, state, job_id, attempt, has_result, error, timestamp}
[:baton, :workflow, :finished]
Emitted by Baton.Completion the moment a workflow's last outstanding
step settles โ the prompt, per-workflow "done" signal that backs the
{:workflow_finished, _} PubSub event.
Measurements: %{failed_count, total_count}
Metadata: %{workflow_id, workflow_label, outcome, failed_steps, timestamp}
where outcome is :completed or :failed.
[:baton, :workflow, :failed]
Emitted by Baton.Plugin on its sweep when a workflow fully terminates
with at least one failed step. Unlike :finished, this is poll-based and only
fires for failures โ useful as an alerting backstop.
Measurements: %{failed_count, total_count}
Metadata: %{workflow_id, workflow_label}
[:baton, :plugin, :rescued]
Emitted when the plugin cancels orphaned jobs.
Measurements: %{count} ยท Metadata: %{job_ids}
[:baton, :plugin, :sweep, :start | :stop | :exception]
A :telemetry.span/3 around each plugin health sweep (orphan rescue +
failed-workflow detection).
[:baton, :plugin, :prune, :start | :stop | :exception]
A :telemetry.span/3 around each plugin prune sweep, when prune: true.
[:baton, :workflow, :finished] from Baton.CompletionReporter
The reporter (attached by Baton.Plugin) listens to [:oban, :job, :exception]
and drives the same exactly-once Baton.Completion.announce/2 as the sweep, so
crash-terminated workflows emit :finished the instant they settle rather than
waiting for the next sweep.
Default logger
Attach a simple Logger-based handler (handy in dev):
Baton.Telemetry.attach_default_logger()In production, attach your own handlers to route to Sentry, PagerDuty, etc.