# `Zharp.Oban`
[🔗](https://github.com/zharp-io/zharp-elixir-lib/blob/v0.1.0/lib/zharp/oban.ex#L1)

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.

# `insert`

`Oban.insert/2`, with the current trace in the job's meta.

# `insert!`

`Oban.insert!/2`, with the current trace in the job's meta.

# `with_trace`

The job changeset with the current trace in its meta.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
