Sha256: 8bd378a233dc20bf64493612df18f376e4f5f8b65c6b4f213ce2bfbd73ce18a7

Contents?: true

Size: 700 Bytes

Versions: 6

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Instrumentation
    module Rails
      module Patches
        module ActionController
          # Module to prepend to ActionController::Metal for instrumentation
          module Metal
            def dispatch(name, request, response)
              rack_span = OpenTelemetry::Instrumentation::Rack.current_span
              rack_span.name = "#{self.class.name}##{name}" if rack_span.context.valid? && !request.env['action_dispatch.exception']
              super(name, request, response)
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-rails-0.16.0 lib/opentelemetry/instrumentation/rails/patches/action_controller/metal.rb
opentelemetry-instrumentation-rails-0.15.0 lib/opentelemetry/instrumentation/rails/patches/action_controller/metal.rb
opentelemetry-instrumentation-rails-0.14.0 lib/opentelemetry/instrumentation/rails/patches/action_controller/metal.rb
opentelemetry-instrumentation-rails-0.13.0 lib/opentelemetry/instrumentation/rails/patches/action_controller/metal.rb
opentelemetry-instrumentation-rails-0.12.0 lib/opentelemetry/instrumentation/rails/patches/action_controller/metal.rb
opentelemetry-instrumentation-rails-0.11.0 lib/opentelemetry/instrumentation/rails/patches/action_controller/metal.rb