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 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.