Oban jobs as spans, in the trace of the request that queued them.
Each job runs in a span of its own (MyApp.Workers.Receipt process), with its queue, attempt
and id; a job that raises is an error. Oban has no hook for changing a job as it is inserted,
so to run a job in the request's trace, insert it through Zharp (the same meta keys
opentelemetry_oban uses):
MyApp.Workers.Receipt.new(%{order_id: order.id}) |> Zharp.Oban.insert()or add the trace to a changeset you insert yourself with Zharp.Oban.with_trace/1. Without
it the job is a trace of its own.
Summary
Functions
Oban.insert/2, with the current trace in the job's meta.
Oban.insert!/2, with the current trace in the job's meta.
The job changeset with the current trace in its meta.