OpentelemetryOban (opentelemetry_oban v0.2.0-rc.2)

OpentelemetryOban uses telemetry handlers to create OpenTelemetry spans from Oban events.

Supported events include job start/stop and also when an exception is raised.

Usage

In your application start:

def start(_type, _args) do
  OpentelemetryOban.setup()

  # ...
end

Link to this section Summary

Link to this section Functions

Link to this function

insert(name \\ Oban, changeset)

Link to this function

insert(name \\ Oban, multi, multi_name, changeset_or_fun)

Link to this function

insert!(name \\ Oban, changeset)

Link to this function

insert_all(name \\ Oban, changesets_or_wrapper)

Link to this function

insert_all(name \\ __MODULE__, multi, multi_name, changesets_or_wrapper)

Link to this function

setup(opts \\ [])

Initializes and configures telemetry handlers.

Sampling

By default only jobs are sampled. If you wish to sample plugins as well then use:

OpentelemetryOban.setup(trace: [:jobs, :plugins])

It is also possible to provide your own sampler:

OpentelemetryOban.setup(
  trace: [
    jobs: :otel_sampler.new(:always_on),
    plugins: :otel_sampler.new(:always_on)
  ]
)