Sentry-ruby: Grape API - Raven

Created on 30 Sep 2015  Â·  6Comments  Â·  Source: getsentry/sentry-ruby

Hi Im using Grape API https://github.com/ruby-grape/grape. How do I configure raven to send exceptions happening in Grape? Thanks.

question

Most helpful comment

Try this:

In your Gemfile:

gem 'sentry-raven', require: 'sentry-raven-without-integrations'

Then in your Grape controller:

require 'raven/integrations/rack'

class API < Grape::API
  use Raven::Rack
end

All 6 comments

Hi Steve

What have you tried so far?

Matt

@steverob Are you using Grape standalone as a Rack app, or as part of a Rails app or Sinatra app?

Using it in a Rails app :)

Regards
Steve Robinson

On 01-Oct-2015, at 4:56 PM, Nate Berkopec [email protected] wrote:

@steverob Are you using Grape standalone as a Rack app, or as part of a Rails app or Sinatra app?

—
Reply to this email directly or view it on GitHub.

@nateberkopec any answer please? I am using Grape inside of Rails too and I would like to setup Sentry just for the Grape part without affecting Rails at all ... is it possible?

Try this:

In your Gemfile:

gem 'sentry-raven', require: 'sentry-raven-without-integrations'

Then in your Grape controller:

require 'raven/integrations/rack'

class API < Grape::API
  use Raven::Rack
end

@nateberkopec In addition I had to do require 'raven/integrations/rack' but it worked! Thank you

Was this page helpful?
0 / 5 - 0 ratings