Module: HoneycombRails::Extensions::ActionController::InstanceMethods

Defined in:
lib/honeycomb-rails/extensions/action_controller.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#honeycomb_metadataHash<String=>Any> (readonly)

Hash of metadata to be added to the event we will send to Honeycomb for the current request.

To annotate the event with custom information (e.g. from a particular controller action), just add data to this hash: e.g.

[:num_posts] = @posts.size

Returns:

  • (Hash<String=>Any>)


26
27
28
# File 'lib/honeycomb-rails/extensions/action_controller.rb', line 26

def 
  @honeycomb_metadata
end

Class Method Details

.included(controller_class) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/honeycomb-rails/extensions/action_controller.rb', line 5

def self.included(controller_class)
  super

  controller_class.before_action do
    honeycomb_initialize
  end
end

Instance Method Details

#honeycomb_initializeObject



13
14
15
# File 'lib/honeycomb-rails/extensions/action_controller.rb', line 13

def honeycomb_initialize
  @honeycomb_metadata = {}
end