Skip to content

Instantly share code, notes, and snippets.

@bensheldon
Created September 18, 2018 15:50
Show Gist options
  • Save bensheldon/78cb570265829f990dd0dfab74cb3551 to your computer and use it in GitHub Desktop.
Save bensheldon/78cb570265829f990dd0dfab74cb3551 to your computer and use it in GitHub Desktop.
# config/initializers/skylight.rb
Rails.application.config.skylight.environments += %w[staging]
instrumenter = Skylight.instrumenter
if instrumenter.present?
ApplicationJob.around_perform do |job, block|
title = "#{job.class.name}#perform"
queue = job.queue_name
segment = queue != 'default' ? "<sk-segment>#{queue}</sk-segment>" : ""
instrumenter.trace("#{title}#{segment}", 'app.activejob.job', title) do
block.call
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment