Skip to content

Report Sidekiq jobs that call other jobs #2379

Open
@kaylareopelle

Description

@kaylareopelle

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

Internal - Slack

Priority

TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    3Story Point EstimateGTSEIssue associated with a previously logged support escalationfeature requestTo tag feature request after Hero Triage for PM to dispositionneeds reviewoct-dec qtrPossible FY Q3 candidate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions