Gem updated 3.1.4. Asynchronous + Current User.

We’ve a few gem in the latest gem. The Airbrake Gem has just passed 500,000 downloads, making a grand total of over 1,295,000 downloads including the old hoptoad_notifier. If you’re still using the Hoptoad notifier… this is the time to upgrade.

Along with the normal bugfixes and issues. We’ve two new features in this Gem.

  • Asynchronous Notify
  • Current User. Which user was affect by the error.

Asynchronous Notify

When your user experiences error using your application, it gets sent to Airbrake server. This introduces a considerable latency in the response.

Asynchronous notification sending deals with this problem. Airbrake uses girl_friday to achieve this . (thanks Mike)

It’s disabled by default and you can enable it in your Airbrake configuration.

Airbrake.configure do |config|
  ...
  config.async = true
end

Note that this feature is enabled with JRuby 1.6+, Rubinius 2.0+ and Ruby 1.9+. It does not support Ruby 1.8 because of its poor threading support.

For implementing custom asynchronous notice delivery, send a block to config.async. It receives notice param. Pass it to Airbrake.sender.send_to_airbrake method to do actual delivery. In this way it’s possible to move Airbrake notification even in background worker(e.g. Resque or Sidekiq).

# Thread-based asynchronous send
Airbrake.configure do |config|
  ...
  config.async do |notice|
    Thread.new { Airbrake.sender.send_to_airbrake(notice) }
  end
end

# Resque-like configuration
Airbrake.configure do |config|
  ...
  config.async do |notice|
    Resque.enqueue(AirbrakeDeliveryWorker, notice)
  end
end

Current User

Airbrake provides information about the current logged in user, so you could easily determine the user who experienced the error in your app.

It uses current_user and current_member to identify the authenticated user, where current_user takes precendence.

If you use different naming, please add the following lines to your controller:

alias_method :current_duck, :current_user
helper_method :current_duck

Voila! You’ll get information about a duck that experienced crash about your app.

Download.

3.1.4 is currently available on RubyGems.

View the Gem on Github.

Change Log.

Version 3.1.4 - 2012-09-11 04:31:51 +0200
===============================================================================

Ben Arent (1):
      Update to MIT license to reflect new ownership.

Hrvoje Šimić (4):
      remove activesupport from runtime dependencies
      use different logger for async notices
      Merge pull request #118 from exviva/load_initializer_conditionally
      symbolize user's keys

Olek Janiszewski (1):
      Fallback to loading whole environment if initializer does not exist

Version 3.1.3 - 2012-09-05 18:58:27 +0200
===============================================================================

Ben Arent (1):
      Removed old mailing list.

Dylan Smith (1):
      Use debug log level for verbose log messages.

Hrvoje Šimić (21):
      add a note for testing against different frameworks
      add a scenario to make sure 404s are ignored by default
      failing scenario for #100
      remove unnecessary bundler/setup requirement
      move dependencies from Gemfile to gemspec
      send info about the current logged in user
      add async notifications
      use async? instead of asnyc
      add info about logger
      prefer provided error message over original exception message
      don't load entire environment for deploy task
      safely handle render exception
      remove unnecessary AirbrakeError
      update XML schema
      test fixes
      clean whitespace
      print the failed notice details
      update supported rails versions
      update scenarios
      stop converting notice to xml before passing it to sender
      remove logger from rack handler
      update supported rails versions

John Pignata (1):
      Cherry-pick Object#blank? extension

Joshua Wood (2):
      rbenv support
      Fixes outdated rake feature.

Matt Colyer (1):
      Fix Airbrake so it actually reports data.

Morgan Mikel McDaris (1):
      changed notify to notify_or_ignore

Sergii Boiko (2):
      Refactor config.async to provide custom asynchronous delivery way
      Simplify config.async to use only notice param

grosser (2):
      fix exceeded available parameter key space breaks notification, fixes #99
      make all tests runnable via ruby test_file.rb by loading the helper absolutely

Monitor Your App Free for 30 Days

Discover the power of Airbrake by starting a free 30-day trial of Airbrake. Quick sign-up, no credit card required. Get started.

Reader Interactions

Trackbacks