Sha256: dcfe3f7517f278c3462497a357e68a6d3e22f24781b6e60e698c833cfc767417

Contents?: true

Size: 705 Bytes

Versions: 2

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

module OpenTracing
  module Instrumentation
    module Thrift
      # Tags builder for TracedProcessor
      class TracedProcessorTagsBuilder < TracedProtocolTagsBuilder
        DEFAULT_STATIC_TAGS = {
          'span.kind' => 'server',
          'component' => 'thrift',
        }.freeze

        def initialize(static_tags: DEFAULT_STATIC_TAGS)
          super()
          @static_tags = static_tags
        end

        def build_tags(protocol, name, type)
          static_tags
            .merge(build_protocol_tags(protocol))
            .merge(build_message_tags(name, type))
        end

        private

        attr_reader :static_tags
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
opentracing-instrumentation-0.2.1 lib/opentracing/instrumentation/thrift/traced_processor_tags_builder.rb
opentracing-instrumentation-0.2.0 lib/opentracing/instrumentation/thrift/traced_processor_tags_builder.rb