Sha256: 7219590407a6a0c3956f1d3186781b06b040686bef6022f93e5a0796ca9c0e5c

Contents?: true

Size: 836 Bytes

Versions: 34

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

module Appsignal
  module Rack
    # @api private
    class RailsInstrumentation < Appsignal::Rack::AbstractMiddleware
      def initialize(app, options = {})
        options[:request_class] ||= ActionDispatch::Request
        options[:params_method] ||= :filtered_parameters
        options[:instrument_event_name] = nil
        options[:report_errors] = true
        super
      end

      private

      def add_transaction_metadata_after(transaction, request)
        controller = request.env["action_controller.instance"]
        transaction.set_action_if_nil("#{controller.class}##{controller.action_name}") if controller

        request_id = request.env["action_dispatch.request_id"]
        transaction.add_tags(:request_id => request_id) if request_id

        super
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
appsignal-4.2.0-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.2.0 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.1.3-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.1.3 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.1.2-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.1.2 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.1.1-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.1.1 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.1.0-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.1.0 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.9-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.9 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.8-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.8 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.7-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.7 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.6-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.6 lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.5-java lib/appsignal/rack/rails_instrumentation.rb
appsignal-4.0.5 lib/appsignal/rack/rails_instrumentation.rb