Sha256: 6ce245c1ca6a165871df7b26c08e60d8aeabe736a9bd2925329526478d8f9213

Contents?: true

Size: 530 Bytes

Versions: 11

Compression:

Stored size: 530 Bytes

Contents

require "ddtrace"

module Hermes
  module Tracers
    class Datadog
      attr_reader :klass
      private     :klass

      def initialize(klass)
        @klass = klass
      end

      def handle(message)
        tracer = ::Datadog.respond_to?(:tracer) ? ::Datadog.tracer : "Datadog::Tracing".safe_constantize

        tracer.trace(
          klass.class.name || klass.class.to_s,
          service: "hermes",
          span_type: "rabbitmq"
        ) do
          klass.process(message)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hermes-rb-0.10.1 lib/hermes/tracers/datadog.rb
hermes-rb-0.10.0 lib/hermes/tracers/datadog.rb
hermes-rb-0.9.1 lib/hermes/tracers/datadog.rb
hermes-rb-0.9.0 lib/hermes/tracers/datadog.rb
hermes-rb-0.8.0 lib/hermes/tracers/datadog.rb
hermes-rb-0.7.5 lib/hermes/tracers/datadog.rb
hermes-rb-0.7.4 lib/hermes/tracers/datadog.rb
hermes-rb-0.7.3 lib/hermes/tracers/datadog.rb
hermes-rb-0.7.2 lib/hermes/tracers/datadog.rb
hermes-rb-0.7.1 lib/hermes/tracers/datadog.rb
hermes-rb-0.7.0 lib/hermes/tracers/datadog.rb