Skip to content

Instantly share code, notes, and snippets.

@gmaliar
Created February 11, 2019 11:44
Show Gist options
  • Save gmaliar/646812671b86de8cf1e5e015db58d0b8 to your computer and use it in GitHub Desktop.
Save gmaliar/646812671b86de8cf1e5e015db58d0b8 to your computer and use it in GitHub Desktop.
require 'prometheus/client'
prometheus = Prometheus::Client.registry
$email_job_retries = prometheus.counter(:http_requests, 'A counter of Email jobs that were retried')
ActiveSupport::Notifications.subscribe "enqueue_retry.active_job" do |name, start, finish, id, payload|
$email_job_retries.increment({ job: payload[:job] })
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment