README.md in sentry-raven-0.10.1 vs README.md in sentry-raven-0.11.1

- old
+ new

@@ -6,64 +6,47 @@ A client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API. ## Requirements -We test on Ruby MRI 1.8.7, 1.9.3 and 2.0.0. Rubinius and JRuby support is experimental. +We test on Ruby MRI 1.8.7/REE, 1.9.3, 2.0 and 2.1. JRuby support is experimental - check TravisCI to see if the build is passing or failing. ## Installation ```ruby -gem "sentry-raven" #, :github => "getsentry/raven-ruby" +gem "sentry-raven", :require => 'raven' #, :github => "getsentry/raven-ruby" ``` ## Usage -The minimum configuration require setting the ``SENTRY_DSN`` with value found on your Sentry project settings page. It should resemble something like ```https://public:secret@app.getsentry.com/9999```. See [Configuration](#configuration) for configuration methods, and other options. +Set the ``SENTRY_DSN`` environment variable with the value found on your Sentry project settings page. It should resemble something like ```https://public:secret@app.getsentry.com/9999```. Many implementations will automatically capture uncaught exceptions (such as Rails, Sidekiq or by using the Rack middleware). If you catch those exceptions yourself, but still want to report on them, see section [Capturing Events](#capturing-events). -### Rails 3 or 4 +### Rails -In Rails 3 or 4 all uncaught exceptions will be automatically reported under most situations. +In Rails, all uncaught exceptions will be automatically reported. -You'll still want to ensure you've disabled anything that would prevent errors from being propagated to the ```Raven::Rack``` middleware: +You'll still want to ensure you've disabled anything that would prevent errors from being propagated to the ```Raven::Rack``` middleware, like ```ActionDispatch::ShowExceptions```: -Disable ```ActionDispatch::ShowExceptions```: - ```ruby -config.action_dispatch.show_exceptions = false +config.action_dispatch.show_exceptions = false # this is the default setting in production ``` -#### Delayed::Job - -No extra configuration required. Usage of [delayed-plugins-raven](https://github.com/qiushihe/delayed-plugins-raven) gem is deprecated. - -### Rails 2 - -No support for Rails 2 yet, but it is being worked on. - ### Rack -Add ```use Raven::Rack``` to your ```config.ru``` (or other rackup file). +Add ```use Raven::Rack``` to your ```config.ru``` or other rackup file (this is automatically inserted in Rails). ### Sinatra Like any other Rack middleware, add ```use Raven::Rack``` to your Sinatra app. -### Sidekiq +### Sidekiq, Delayed::Job and Rake -Raven includes [Sidekiq middleware](https://github.com/mperham/sidekiq/wiki/Middleware) which takes -care of reporting errors that occur in Sidekiq jobs. To use it, just require the middleware by doing +Raven works out-of-the-box with all these tools! -```ruby -require 'raven/sidekiq' -``` -after you require Sidekiq. If you are using Sidekiq with Rails, just put this require somewhere in the initializers. - - ## Capturing Events Many implementations will automatically capture uncaught exceptions (such as Rails, Sidekiq or by using the Rack middleware). Sometimes you may want to catch those exceptions, but still report on them. @@ -164,28 +147,28 @@ Raven.user_context({}) end end ``` - ## Configuration ### SENTRY_DSN After you complete setting up a project, you'll be given a value which we call a DSN, or Data Source Name. It looks a lot like a standard URL, but it's actually just a representation of the configuration required by Raven (the Sentry client). It consists of a few pieces, including the protocol, public and secret keys, the server address, and the project identifier. With Raven, you may either set the ```SENTRY_DSN``` environment variable (recommended), or set your DSN manually in a config block: ```ruby +# in Rails, this might be in config/initializers/sentry.rb Raven.configure do |config| config.dsn = 'http://public:secret@example.com/project-id' end ``` ### Environments -By default, events will be sent to Sentry in all environments. If you do not wish +As of [v0.10.0](https://github.com/getsentry/raven-ruby/blob/21cb3164e0d0ab91394ba98b78195c4f6342b4bb/changelog.md#0100), events will be sent to Sentry in all environments. If you do not wish to send events in an environment, we suggest you unset the ```SENTRY_DSN``` variable in that environment. Alternately, you can configure Raven to run only in certain environments by configuring the `environments` whitelist. For example, to only run Sentry in production: @@ -213,10 +196,20 @@ Raven.configure do |config| config.excluded_exceptions = ['ActionController::RoutingError', 'ActiveRecord::RecordNotFound'] end ``` -You can find the list of exceptions that are excluded by default in [Raven::Configuration::IGNORE_DEFAULT](https://github.com/getsentry/raven-ruby/blob/master/lib/raven/configuration.rb#L74-L80). Remember you'll be overriding those defaults by setting this configuration. +You can find the list of exceptions that are excluded by default in [Raven::Configuration::IGNORE_DEFAULT](https://github.com/getsentry/raven-ruby/blob/master/lib/raven/configuration.rb). Remember you'll be overriding those defaults by setting this configuration. + +You can also use a configuration option to determine if an individual event should +be sent to Sentry. Events are passed to the Proc or lambda you provide - returning +`false` will stop the event from sending to Sentry: + +```ruby +Raven.configure do |config| + config.should_send = Proc.new { |e| true unless e.contains_sensitive_info? } +end +``` ### Tags You can configure default tags to be sent with every event. These can be overridden in the context or event.