Honeybadger.Insights.Oban (Honeybadger v0.24.1)

View Source

Captures telemetry events from Oban job processing.

Default Configuration

By default, this module listens for the following Oban telemetry events:

"oban.job.stop" "oban.job.exception"

Custom Configuration

You can customize the telemetry events to listen for by updating the insights_config:

config :honeybadger, insights_config: %{

 oban: %{
   telemetry_events: [
     [:oban, :job, :stop],
     [:oban, :job, :exception],
     [:oban, :engine, :start]
   ]
 }

}

Summary

Functions

Adds the current Honeybadger event context to the Oban job's metadata.

Attaches telemetry handlers if all required dependencies are available.

Attaches a telemetry handler for a specific event.

Extracts metadata from the telemetry event. Child modules should override this for specific events.

Implementation of handle_telemetry that can be called by overriding methods.

Handles telemetry events and processes the data. This implementation forwards to handle_event_impl which can be overridden by child modules to customize behavior while still calling the parent implementation.

Determines if an event should be ignored based on its metadata. Child modules should override this for specific filtering logic. Note: this is the metadata before any transformations.

Process the event data. Child modules can override this for custom processing.

Functions

add_event_context(changeset)

Adds the current Honeybadger event context to the Oban job's metadata.

Example

MyApp.Worker.new()
|> Honeybadger.Insights.Oban.add_event_context()
|> Oban.insert()

attach()

Attaches telemetry handlers if all required dependencies are available.

attach_event(event)

Attaches a telemetry handler for a specific event.

dependencies_available?()

event_filter(map, meta, event)

extract_metadata(meta, event)

Extracts metadata from the telemetry event. Child modules should override this for specific events.

get_insights_config(key, default)

get_telemetry_events()

handle_event_impl(event, measurements, metadata, opts)

Implementation of handle_telemetry that can be called by overriding methods.

handle_telemetry(event, measurements, metadata, opts)

Handles telemetry events and processes the data. This implementation forwards to handle_event_impl which can be overridden by child modules to customize behavior while still calling the parent implementation.

ignore?(metadata)

Determines if an event should be ignored based on its metadata. Child modules should override this for specific filtering logic. Note: this is the metadata before any transformations.

process_event(event_data)

Process the event data. Child modules can override this for custom processing.