Log ActiveJob APM Traces with DataDog

Viewed 257

my configuration is:

Datadog.configure do |c|
  c.tracer enabled: Rails.env.production? || ENV['DD_TRACE_ENABLED'] == 'true'
  c.tracer analytics_enabled: true

  c.use :rails, service_name: 'rails'
  c.use :resque, workers: ApplicationJob.subclasses + ApplicationWorker.subclasses, service_name: 'resque'
  c.use :http, service_name: 'http'
  c.use :redis, service_name: 'redis'
end

Where:

  • The ApplicationJob signature is class ApplicationJob < ActiveJob::Base
  • The ApplicationWorker is used as a parent class for vanilla Resque classes.

I'm not getting any errors, but I am seeing the subclasses of ApplicationWorker in the DataDog dashboard for the APM traces but not the ApplicationJob subclasses.

From the documentation I've found this is the correct way to configure activeJob tracing when it uses resque, but I haven't found such great documentation on the subject.

1 Answers
Related