Sha256: 54ede2343c8a624f61fee2eda3d4cd6fdd776ee91d6eb3cf0272401ecd88d6f6

Contents?: true

Size: 1.05 KB

Versions: 16

Compression:

Stored size: 1.05 KB

Contents

# typed: true

module Datadog
  module Tracing
    module Contrib
      module Sidekiq
        module ServerInternalTracer
          # Trace when Sidekiq looks for another job to work
          module JobFetch
            private

            def fetch
              configuration = Datadog.configuration.tracing[:sidekiq]

              Datadog::Tracing.trace(Ext::SPAN_JOB_FETCH, service: configuration[:service_name]) do |span|
                span.span_type = Datadog::Tracing::Metadata::Ext::AppTypes::TYPE_WORKER

                span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
                span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_JOB_FETCH)

                # 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
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.8.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.7.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.6.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.6.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.5.2 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.5.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.5.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.4.2 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.4.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.4.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.3.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.2.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.1.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.0.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.0.0.beta2 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb