lib/instana/instrumentation/resque.rb in instana-1.9.0.sillyrabbit vs lib/instana/instrumentation/resque.rb in instana-1.9.0
- old
+ new
@@ -18,11 +18,11 @@
kvs[:queue] = klass.instance_variable_get(:@queue)
rescue => e
Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
end
- kvs
+ { :'resque-client' => kvs }
end
def enqueue_with_instana(klass, *args)
if Instana.tracer.tracing?
kvs = collect_kvs(:enqueue, klass, args)
@@ -70,16 +70,15 @@
kvs = {}
begin
kvs[:job] = job.payload['class'].to_s
kvs[:queue] = job.queue
- kvs[:args] = job.payload['args'].to_json
rescue => e
- Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if Instana::Config[:verbose]
+ ::Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if Instana::Config[:verbose]
end
- Instana.tracer.start_or_continue_trace(:'resque-worker', nil, kvs) do
+ Instana.tracer.start_or_continue_trace(:'resque-worker', { :'resque-worker' => kvs }) do
perform_without_instana(job)
end
end
end
@@ -88,11 +87,15 @@
::Instana::Util.method_alias(klass, :fail)
end
def fail_with_instana(exception)
if Instana.tracer.tracing?
- Instana.tracer.log_error(:resque, exception)
+ ::Instana.tracer.log_info(:'resque-worker' => { :error => "#{exception.class}: #{exception}"})
+ ::Instana.tracer.log_error(exception)
end
+ rescue Exception => e
+ ::Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if Instana::Config[:verbose]
+ ensure
fail_without_instana(exception)
end
end
end
end