Sha256: 75ab9565da122a969624a4696bdd3dcf7dd07ba4e228b2199aa693a49c5ebfc6

Contents?: true

Size: 646 Bytes

Versions: 37

Compression:

Stored size: 646 Bytes

Contents

module Appsignal
  module Rack
    class Instrumentation
      def initialize(app, options = {})
        @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

37 entries across 37 versions & 1 rubygems

Version Path
appsignal-0.8.15 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.14 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.13 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.12 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.11 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.10 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.8 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.7 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.7.alpha.1 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.6 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.6.beta.1 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.6.beta.0 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.5 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.4 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.4.beta.1 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.4.beta.0 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.3 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.3.beta.1 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.3.beta.0 lib/appsignal/rack/instrumentation.rb
appsignal-0.8.2 lib/appsignal/rack/instrumentation.rb