Class: Skylight::Core::Normalizers::ActionController::ProcessAction Private

Inherits:
Normalizer
  • Object
show all
Defined in:
lib/skylight/core/normalizers/action_controller/process_action.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Normalizer for processing a Rails controller action

Constant Summary collapse

CAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"app.controller.request".freeze

Instance Attribute Summary

Attributes inherited from Normalizer

#config

Instance Method Summary collapse

Methods inherited from Normalizer

#initialize, register

Constructor Details

This class inherits a constructor from Skylight::Core::Normalizers::Normalizer

Instance Method Details

#normalize(trace, _name, payload) ⇒ Array

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • trace (Skylight::Messages::Trace::Builder)
  • name (String)

    ignored, only present to match API

  • payload (Hash)

Options Hash (payload):

  • :controller (String)

    Controller name

  • :action (String)

    Action name

Returns:

  • (Array)


20
21
22
23
# File 'lib/skylight/core/normalizers/action_controller/process_action.rb', line 20

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

#normalize_after(trace, _span, _name, payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
28
29
30
31
# File 'lib/skylight/core/normalizers/action_controller/process_action.rb', line 25

def normalize_after(trace, _span, _name, payload)
  return unless config.enable_segments?

  if (segment = segment_from_payload(payload))
    trace.segment = segment
  end
end