Module: Honeycomb::Rails

Included in:
Middleware
Defined in:
lib/honeycomb/integrations/rails.rb

Overview

Rails specific methods for building middleware

Defined Under Namespace

Classes: Middleware

Instance Method Summary collapse

Instance Method Details

#add_package_information(env) {|"meta.package", "rails"| ... } ⇒ Object

Yields:

  • ("meta.package", "rails")


10
11
12
13
14
15
16
17
18
19
# File 'lib/honeycomb/integrations/rails.rb', line 10

def add_package_information(env)
  yield "meta.package", "rails"
  yield "meta.package_version", ::Rails::VERSION::STRING

  request = ::ActionDispatch::Request.new(env)

  yield "request.controller", request.path_parameters[:controller]
  yield "request.action", request.path_parameters[:action]
  yield "request.route", route_for(request)
end