---
title: 'Hoptoad Notifier: Rack and Automatic Metal Support'
teaser: The big news in Hoptoad Notifier 2.2.
tags: news,airbrake
author: Jason Morrison
published_on: 2010-02-18
---

> If you're not sending your application errors to our hosted service
> [Hoptoad](http://hoptoadapp.com), take a few minutes and try it out for free
> today!

The newest version of the official Hoptoad Notifier, 2.2, was [released to
Gemcutter](http://gemcutter.org/gems/hoptoad_notifier) today, and brings with it
support for Rack, automatic notification of exceptions occurring in Rails Metal
endpoints, and some Rails 1.2.6 fixes.

## Rack support

From the [README](http://github.com/thoughtbot/hoptoad_notifier/blob/master/README.md):

In order to use hoptoad\_notifier in a non-Rails rack app, just load the
hoptoad\_notifier, configure your <abbr title="Application Programming
Interface">API</abbr> key, and use the HoptoadNotifier::Rack middleware:

```ruby
require 'rack'
require 'hoptoad_notifier'

HoptoadNotifier.configure do |config|
  config.api_key = 'my_api_key'
end

app = Rack::Builder.app do
  use HoptoadNotifier::Rack
  run lambda { |env| raise "Rack down" }
end
```

This makes the notifier usable in any Rack-based application, including Merb or
Sinatra.  The
[README](http://github.com/thoughtbot/hoptoad_notifier/blob/master/README.md)
also includes an example for using the Rack notifier in Sinatra.

![Atticus mans a very fashionable wine rack](http://images.thoughtbot.com/ui/frogwine.jpg)

## Automatic metal notification

The `Hoptoad::Rails` module also uses this Rack support to provide automatic
Hoptoad notification from within your [Rails
Metal](http://guides.rubyonrails.org/rails_on_rack.html#rails-metal-applications)
applications:

```ruby
if defined?(::Rails.configuration) && ::Rails.configuration.respond_to?(:middleware)
  ::Rails.configuration.middleware.insert_after 'ActionController::Failsafe',
                                                HoptoadNotifier::Rack
end
```

This means that any exceptions during requests handled by metal endpoints in
your Rails application will automatically be sent to Hoptoad, just like requests
that are handled by ActionController.

![Atticus does metal](http://images.thoughtbot.com/ui/ozzyfrog.jpg)

You can read about the other changes in 2.2 (including fixes for Rails 1.2.6) in
the
[CHANGELOG](http://github.com/thoughtbot/hoptoad_notifier/blob/master/CHANGELOG).

FYI: Hoptoad/Airbrake was sold to RackSpace and is now called
[Airbrake Bug Tracker](http://airbrake.io)
