Created
September 18, 2018 15:50
-
-
Save bensheldon/78cb570265829f990dd0dfab74cb3551 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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