Sha256: c39d57ebe8c092ae4cf8a46daa9a58481c95776ae0167a123682e69bea37a150

Contents?: true

Size: 889 Bytes

Versions: 6

Compression:

Stored size: 889 Bytes

Contents

module ActiveSupport
  module Cache
    module Tracer
      class << self
        def start_span(operation_name, tracer: OpenTracing.global_tracer, active_span: nil, start_time: Time.now, event:, **fields)
          span = tracer.start_span(operation_name,
                                   child_of: active_span.respond_to?(:call) ? active_span.call : active_span,
                                   start_time: start_time,
                                   tags: {
                                    'component' => 'ActiveSupport::Cache',
                                    'span.kind' => 'client',
                                    'cache.key' => fields.fetch(:key, 'unknown')
                                   })

          if event == 'read'
            span.set_tag('cache.hit', fields.fetch(:hit, false))
          end

          span
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
signalfx-rails-instrumentation-0.1.4 lib/rails/active_support/cache/manual_tracer.rb
signalfx-rails-instrumentation-0.1.3 lib/rails/active_support/cache/manual_tracer.rb
signalfx-rails-instrumentation-0.1.2 lib/rails/active_support/cache/manual_tracer.rb
signalfx-rails-instrumentation-0.1.1 lib/rails/active_support/cache/manual_tracer.rb
signalfx-rails-instrumentation-0.1.0 lib/rails/active_support/cache/manual_tracer.rb
rails-tracer-0.5.0 lib/rails/active_support/cache/manual_tracer.rb