Module: Airbrake

Defined in:
lib/airbrake.rb,
lib/airbrake/version.rb,
lib/airbrake/rack/user.rb,
lib/airbrake/rails/railtie.rb,
lib/airbrake/rack/middleware.rb,
lib/airbrake/rails/active_job.rb,
lib/airbrake/capistrano/tasks.rb,
lib/airbrake/rack/notice_builder.rb,
lib/airbrake/rails/active_record.rb,
lib/airbrake/sidekiq/error_handler.rb,
lib/airbrake/rails/action_controller.rb

Overview

We use Semantic Versioning v2.0.0 More information: semver.org/

Defined Under Namespace

Modules: Capistrano, Rack, Rails, Sidekiq

Constant Summary collapse

AIRBRAKE_VERSION =
'5.6.1'.freeze

Class Method Summary collapse

Class Method Details

.add_rack_builder {|notice, request| ... } ⇒ void

This method returns an undefined value.

Attaches a callback (builder) that runs every time the Rack integration reports an error. Can be used to attach additional data from the Rack request.

Examples:

Adding remote IP from the Rack environment

Airbrake.add_rack_builder do |notice, request|
  notice[:params][:remoteIp] = request.env['REMOTE_IP']
end

Yield Parameters:

  • notice (Airbrake::Notice)

    notice that will be sent to Airbrake

  • request (Rack::Request)

    current rack request

Yield Returns:

  • (void)

Since:

  • 5.1.0


44
45
46
# File 'lib/airbrake.rb', line 44

def add_rack_builder(&block)
  Airbrake::Rack::NoticeBuilder.add_builder(&block)
end