Sha256: b115631c885af1bb46325568e30174ed34f73ab77268939fabffe0d357908c7e

Contents?: true

Size: 920 Bytes

Versions: 26

Compression:

Stored size: 920 Bytes

Contents

module Skylight
  module Normalizers
    module ActionController
      class ProcessAction < Normalizer
        register "process_action.action_controller"

        CAT = "app.controller.request".freeze
        PAYLOAD_KEYS = %w[ controller action params format method path ].map(&:to_sym).freeze

        def normalize(trace, name, payload)
          trace.endpoint = controller_action(payload)
          [ CAT, trace.endpoint, nil, normalize_payload(payload) ]
        end

      private

        def controller_action(payload)
          "#{payload[:controller]}##{payload[:action]}"
        end

        def normalize_payload(payload)
          normalized = {}

          PAYLOAD_KEYS.each do |key|
            val = payload[key]
            val = val.inspect unless val.is_a?(String) || val.is_a?(Numeric)
            normalized[key] = val
          end

          normalized
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
skylight-0.8.0.beta.1 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.7.1 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.7.0.beta.3 lib/skylight/normalizers/action_controller/process_action.rb
truex-skylight-0.6.0 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.7.0.beta.2 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.7.0.beta.1 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.6.2.beta.2 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.6.1 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.6.0 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.6.0.beta.1 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.5.2 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.5.1 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.5.0 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.4.3 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.5.0.beta1 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.4.2 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.4.1 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.4.0 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.4.0.beta2 lib/skylight/normalizers/action_controller/process_action.rb
skylight-0.4.0.beta1 lib/skylight/normalizers/action_controller/process_action.rb