Sha256: 98611ba579a8e2b57510155aa49452f7960ccceec5d8b9fa4d5d1d496a928845

Contents?: true

Size: 725 Bytes

Versions: 20

Compression:

Stored size: 725 Bytes

Contents

module Appsignal
  module Rack
    class Instrumentation
      def initialize(app, options = {})
        Appsignal.logger.debug 'Initializing Appsignal::Rack::Instrumentation'
        @app, @options = app, options
      end

      def call(env)
        ActiveSupport::Notifications.instrument(
          'process_action.rack',
          raw_payload(env)
        ) do |payload|
          @app.call(env)
        end
      end

      def raw_payload(env)
        request = ::Rack::Request.new(env)
        {
          :action => "#{request.request_method}:#{request.path}",
          :params => request.params,
          :method => request.request_method,
          :path   => request.path
        }
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
appsignal-0.11.0 lib/appsignal/rack/instrumentation.rb
appsignal-0.11.0.beta.2 lib/appsignal/rack/instrumentation.rb
appsignal-0.11.0.beta.1 lib/appsignal/rack/instrumentation.rb
appsignal-0.10.6 lib/appsignal/rack/instrumentation.rb
appsignal-0.10.5 lib/appsignal/rack/instrumentation.rb
appsignal-0.10.4 lib/appsignal/rack/instrumentation.rb
appsignal-0.10.3 lib/appsignal/rack/instrumentation.rb
appsignal-0.10.2 lib/appsignal/rack/instrumentation.rb
appsignal-0.10.1 lib/appsignal/rack/instrumentation.rb
appsignal-0.10.0 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.6 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.5 lib/appsignal/rack/instrumentation.rb
appsignal-0.10.0.beta.0 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.4 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.3 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.2 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.1 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.0 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.0.beta.1 lib/appsignal/rack/instrumentation.rb
appsignal-0.9.0.alpha.1 lib/appsignal/rack/instrumentation.rb