Sha256: 8596fe28b48920eefa299295047d2bd94afef301fe80d0e9756812f4efe2ead2

Contents?: true

Size: 809 Bytes

Versions: 4

Compression:

Stored size: 809 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Instrumentation
    module Sidekiq
      module Patches
        # The Processor module contains the insturmentation for the process_one method
        module Processor
          private

          def process_one
            if config[:trace_processor_process_one]
              tracer.in_span('Sidekiq::Processor#process_one') { super }
            else
              OpenTelemetry::Common::Utilities.untraced { super }
            end
          end

          def tracer
            Sidekiq::Instrumentation.instance.tracer
          end

          def config
            Sidekiq::Instrumentation.instance.config
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-sidekiq-0.16.0 lib/opentelemetry/instrumentation/sidekiq/patches/processor.rb
opentelemetry-instrumentation-sidekiq-0.15.0 lib/opentelemetry/instrumentation/sidekiq/patches/processor.rb
opentelemetry-instrumentation-sidekiq-0.14.0 lib/opentelemetry/instrumentation/sidekiq/patches/processor.rb
opentelemetry-instrumentation-sidekiq-0.13.0 lib/opentelemetry/instrumentation/sidekiq/patches/processor.rb