Skip to content

Instantly share code, notes, and snippets.

@qrush qrush/application_job.rb
Last active Sep 20, 2019

Embed
What would you like to do?
Use Honeycomb to trace ActiveRecord calls inside of ActiveJob
class ApplicationJob < ActiveJob::Base
around_perform do |job, block|
Honeycomb.start_span(name: job.class.name) do |span|
span.add_field 'type', 'worker'
span.add_field 'queue.name', job.queue_name
block.call
end
end
end
@qrush

This comment has been minimized.

Copy link
Owner Author

commented Jun 10, 2019

This gist adds a new trace for each job your Sidekiq (or whatever runs your jobs) runs:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.