Sha256: 3386969c098f4c48ae83d7da4c00587aad180bbec94720e205906932ed4447da

Contents?: true

Size: 766 Bytes

Versions: 18

Compression:

Stored size: 766 Bytes

Contents

# frozen_string_literal: true

module OpenTracing
  module Instrumentation
    module Bunny
      # HeadersBuilder build AMQP headers
      class HeadersBuilder
        # @param tracer [OpenTracing::Tracer]
        # @param injector [HeadersInjector]
        def initialize(
          tracer: OpenTracing.global_tracer,
          injector: HeadersInjector.new(tracer: tracer)
        )
          @tracer = tracer
          @injector = injector
        end

        # @param active_span [OpenTracing::Span]
        # @return [Hash<String, String>] return injected headers
        def build(active_span: @tracer.active_span)
          headers = {}
          @injector.inject(headers, active_span: active_span)
          headers
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
opentracing-instrumentation-0.2.1 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.2.0 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.18 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.17 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.16 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.15 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.14 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.13 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.12 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.11 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.10 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.9 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.8 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.7 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.6 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.5 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.4 lib/opentracing/instrumentation/bunny/headers_builder.rb
opentracing-instrumentation-0.1.3 lib/opentracing/instrumentation/bunny/headers_builder.rb