Sha256: ad16b264d802ad4922c960ffd518a7936dda7de3262eb04cf5c8c6d3f94e6d59

Contents?: true

Size: 1.16 KB

Versions: 22

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: 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(Contrib::Ext::Messaging::TAG_SYSTEM, Ext::TAG_COMPONENT)

                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

22 entries across 22 versions & 1 rubygems

Version Path
ddtrace-1.23.3 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.23.2 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.23.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.22.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.21.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.21.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.20.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.19.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.18.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.17.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.16.2 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.16.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.16.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.15.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.14.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.13.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.13.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.12.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.12.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb
ddtrace-1.11.1 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb