Sha256: 2c8aee89ff71de5d5457e8e92be83041537d2289d14edc486aa94b5a633b1654

Contents?: true

Size: 896 Bytes

Versions: 4

Compression:

Stored size: 896 Bytes

Contents

# typed: true

module Datadog
  module Contrib
    module Sidekiq
      module ServerInternalTracer
        # Trace when Sidekiq checks to see if there are scheduled jobs that need to be worked
        # https://github.com/mperham/sidekiq/wiki/Scheduled-Jobs
        module ScheduledPush
          def enqueue
            configuration = Datadog.configuration[:sidekiq]

            configuration[:tracer].trace(Ext::SPAN_SCHEDULED_PUSH) do |span|
              span.service = configuration[:service_name]
              span.span_type = Datadog::Ext::AppTypes::WORKER

              # Set analytics sample rate
              if Contrib::Analytics.enabled?(configuration[:analytics_enabled])
                Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate])
              end

              super
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ddtrace-0.54.2 lib/ddtrace/contrib/sidekiq/server_internal_tracer/scheduled_push.rb
ddtrace-0.54.1 lib/ddtrace/contrib/sidekiq/server_internal_tracer/scheduled_push.rb
ddtrace-0.54.0 lib/ddtrace/contrib/sidekiq/server_internal_tracer/scheduled_push.rb
ddtrace-0.53.0 lib/ddtrace/contrib/sidekiq/server_internal_tracer/scheduled_push.rb