Open
Description
Is your feature request related to a problem? Please describe.
The New Relic Ruby agent cannot accurately report on Sidekiq jobs that call other jobs.
For example, if I invoke the following code using OutsideJob.perform_later
, InsideJob
would be the name of the transaction, and OutsideJob
would not appear as a transaction or as a segment within another transaction.
class OutsideJob < ApplicationJob
queue_as :high
def perform
NewRelic::Agent::Tracer.start_transaction_or_segment(name: 'OutsideJob', category: :background) do
puts "OutsideJob: start"
InsideJob.perform_now
puts "OutsideJob: finish"
end
end
end
class InsideJob < ApplicationJob
queue_as :high
def perform
puts "InsideJob: start"
sleep 1
puts "InsideJob: finish"
end
end
Feature Description
Sidekiq jobs that call other Sidekiq jobs are reported to New Relic.
Using the scenario above as an example, OutsideJob
will be used as the root of a non-web transaction and InsideJob
will be a segment/span nested within the OutsideJob
transaction.
Describe Alternatives
If someone encounters this problem, try using custom instrumentation to set the correct transaction name. We suggest you explore:
However, we have not tested these APIs with this scenario, so YMMV.
Additional context
Priority
TBD