Sha256: 0689a3f826f6754f601f5fe090ed2b36cad20ee906ce88ada29299a95e624bc5

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

# typed: true

module Datadog
  module Tracing
    module Contrib
      module Sidekiq
        module ServerInternalTracer
          # Trace when a Sidekiq process has a heartbeat
          module Heartbeat
            private

            def ❤ # rubocop:disable Naming/AsciiIdentifiers, Naming/MethodName
              configuration = Datadog.configuration.tracing[:sidekiq]

              Datadog::Tracing.trace(Ext::SPAN_HEARTBEAT, 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_HEARTBEAT)

                # 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

4 entries across 4 versions & 1 rubygems

Version Path
ddtrace-1.2.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb
ddtrace-1.1.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb
ddtrace-1.0.0 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb
ddtrace-1.0.0.beta2 lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb