PromEx.Plugins.Oban (PromEx v1.1.1) View Source

This plugin captures metrics emitted by Oban. Specifically, it captures metrics from job events, producer events, and also from internal polling jobs to monitor queue sizes

This plugin supports the following options:

  • oban_supervisors: This is an OPTIONAL option and it allows you to specify what Oban instances should have their events tracked. By default the only Oban instance that will have its events tracked is the default Oban instance. As a result, by default this option has a value of [Oban]. If you would like to track other named Oban instances, or perhaps your default and only Oban instance has a different name, you can pass in your own list of Oban instances (e.g. [Oban, Oban.PrivateJobs]).

  • poll_rate: This option is OPTIONAL and is the rate at which poll metrics are refreshed (default is 5 seconds).

This plugin exposes the following metric groups:

  • :oban_init_event_metrics
  • :oban_job_event_metrics
  • :oban_producer_event_metrics
  • :oban_circuit_event_metrics
  • :oban_queue_poll_metrics

To use plugin in your application, add the following to your PromEx module:

defmodule WebApp.PromEx do
  use PromEx, otp_app: :web_app

  @impl true
  def plugins do
    [
      ...
      {PromEx.Plugins.Oban, oban_supervisors: [Oban, Oban.AnotherSupervisor], poll_rate: 10_000}
    ]
  end

  @impl true
  def dashboards do
    [
      ...
      {:prom_ex, "oban.json"}
    ]
  end
end

Link to this section Summary

Link to this section Functions

Link to this function

oban_circuit_breaker_event_metrics(metric_prefix, keep_function_filter)

View Source