Module: Instana::Instrumentation::ActionControllerLegacy

Includes:
ActionControllerCommon
Defined in:
lib/instana/frameworks/instrumentation/action_controller.rb

Overview

Used in ActionPack versions 4 and earlier, this module provides instrumentation for ActionController (a part of ActionPack)

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ActionControllerCommon

#has_rails_handler?

Class Method Details

.included(klass) ⇒ Object



73
74
75
76
77
78
# File 'lib/instana/frameworks/instrumentation/action_controller.rb', line 73

def self.included(klass)
  klass.class_eval do
    alias_method_chain :process_action, :instana
    alias_method_chain :render, :instana
  end
end

Instance Method Details

#process_action_with_instana(*args) ⇒ Object

The Instana wrapper method for ActionController::Base.process_action for versions 3 and 4.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/instana/frameworks/instrumentation/action_controller.rb', line 83

def process_action_with_instana(*args)
  kv_payload = { :actioncontroller => {} }
  kv_payload[:actioncontroller][:controller] = self.class.name
  kv_payload[:actioncontroller][:action] = action_name

  ::Instana.tracer.log_entry(:actioncontroller, kv_payload)

  process_action_without_instana(*args)
rescue Exception => e
  ::Instana.tracer.log_error(e) unless has_rails_handler?
  raise
ensure
  ::Instana.tracer.log_exit(:actioncontroller)
end

#render_with_instana(*args, &blk) ⇒ Object

The Instana wrapper method for ActionController::Base.render for versions 3 and 4.



101
102
103
104
105
106
107
108
109
# File 'lib/instana/frameworks/instrumentation/action_controller.rb', line 101

def render_with_instana(*args, &blk)
  ::Instana.tracer.log_entry(:actionview)
  render_without_instana(*args, &blk)
rescue Exception => e
  ::Instana.tracer.log_error(e) unless has_rails_handler?
  raise
ensure
  ::Instana.tracer.log_exit(:actionview)
end