Sha256: d508c1feca9482cb9e8212a0eb1ee6a3979ff5277a82647c2950fffe0adaeacf

Contents?: true

Size: 668 Bytes

Versions: 4

Compression:

Stored size: 668 Bytes

Contents

# typed: true

require 'datadog/tracing'

module Datadog
  module Tracing
    module Contrib
      module Qless
        # Shutdown Tracer in forks for performance reasons
        module TracerCleaner
          def around_perform(job)
            return super unless datadog_configuration && Tracing.enabled?

            super.tap do
              Tracing.shutdown! if forked?
            end
          end

          private

          def forked?
            Datadog.configuration_for(::Qless, :forked) == true
          end

          def datadog_configuration
            Datadog.configuration.tracing[:qless]
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ddtrace-1.2.0 lib/datadog/tracing/contrib/qless/tracer_cleaner.rb
ddtrace-1.1.0 lib/datadog/tracing/contrib/qless/tracer_cleaner.rb
ddtrace-1.0.0 lib/datadog/tracing/contrib/qless/tracer_cleaner.rb
ddtrace-1.0.0.beta2 lib/datadog/tracing/contrib/qless/tracer_cleaner.rb