Log ActiveJob APM Traces with DataDog

514 views Asked by At

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

There are 1 answers

0
Allen M On

After reading this documentation, https://docs.datadoghq.com/tracing/setup_overview/setup/ruby/#resque, did you try making the options a hash with curly braces surrounding? Options is specified as being a hash. So everything after c.use :resque, should be a hash.