class Skylight::Core::Probes::ActiveJob::Probe

Constants

TITLE

Public Instance Methods

execute(*args) click to toggle source
# File lib/skylight/core/probes/active_job.rb, line 11
def execute(*args)
  Skylight.trace(TITLE, "app.job.execute", component: :worker) do |trace|
    # See normalizers/active_job/perform for endpoint/segment assignment
    begin
      execute_without_sk(*args)
    rescue Exception
      trace.segment = "error" if trace
      raise
    end
  end
end
install() click to toggle source
# File lib/skylight/core/probes/active_job.rb, line 7
def install
  ::ActiveJob::Base.instance_eval do
    alias execute_without_sk execute

    def execute(*args)
      Skylight.trace(TITLE, "app.job.execute", component: :worker) do |trace|
        # See normalizers/active_job/perform for endpoint/segment assignment
        begin
          execute_without_sk(*args)
        rescue Exception
          trace.segment = "error" if trace
          raise
        end
      end
    end
  end
end