Sha256: 6a729786b275770bd3e63493e14843b52ce4d76232b4d419720d3cb370ad9461

Contents?: true

Size: 1.39 KB

Versions: 6

Compression:

Stored size: 1.39 KB

Contents

# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021

module Instana
  module Instrumentation
    module ActionView
      module PartialRenderer
        def render_partial(*args)
          call_payload = {
            render: {
              type: :partial,
              name: @options.is_a?(Hash) ? @options[:partial].to_s : 'Unknown'
            }
          }

          ::Instana::Tracer.trace(:render, call_payload) { super(*args) }
        end

        def render_collection(*args)
          call_payload = {
            render: {
              type: :collection,
              name: @path.to_s
            }
          }

          ::Instana::Tracer.trace(:render, call_payload) { super(*args) }
        end

        def render_partial_template(*args)
          call_payload = {
            render: {
              type: :partial,
              name: @options.is_a?(Hash) ? @options[:partial].to_s : 'Unknown'
            }
          }

          ::Instana::Tracer.trace(:render, call_payload) { super(*args) }
        end
      end

      module CollectionRenderer
        def render_collection(*args)
          call_payload = {
            render: {
              type: :collection,
              name: @options.is_a?(Hash) ? @options[:partial].to_s : 'Unknown'
            }
          }

          ::Instana::Tracer.trace(:render, call_payload) { super(*args) }
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
instana-1.217.1 lib/instana/instrumentation/action_view.rb
instana-1.217.0 lib/instana/instrumentation/action_view.rb
instana-1.216.0 lib/instana/instrumentation/action_view.rb
instana-1.215.1 lib/instana/instrumentation/action_view.rb
instana-1.215.0 lib/instana/instrumentation/action_view.rb
instana-1.214.4 lib/instana/instrumentation/action_view.rb