README.md in sentry-raven-2.5.3 vs README.md in sentry-raven-2.6.0

- old
+ new

@@ -1,12 +1,20 @@ -# Raven-Ruby +<p align="center"> + <img src="https://cdn.rawgit.com/getsentry/raven-python/1e525422/docs/_static/logo.png"> +</p> +# Raven-Ruby, the Ruby Client for Sentry + [![Gem Version](https://img.shields.io/gem/v/sentry-raven.svg)](https://rubygems.org/gems/sentry-raven) [![Build Status](https://img.shields.io/travis/getsentry/raven-ruby/master.svg)](https://travis-ci.org/getsentry/raven-ruby) +[![Gem](https://img.shields.io/gem/dt/sentry-raven.svg)](https://rubygems.org/gems/sentry-raven/) -A client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API. +[Documentation](https://docs.getsentry.com/hosted/clients/ruby/) | [Bug Tracker](https://github.com/getsentry/raven-ruby/issues) | [Forum](https://forum.sentry.io/) | IRC: irc.freenode.net, #sentry + +The official Ruby-language client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API. + ## Requirements We test on Ruby 1.9, 2.2, 2.3, and 2.4 at the latest patchlevel/teeny version. We also support JRuby 1.7 and 9.0. Our Rails integration works with Rails 4.2+ (including Rails 5). ## Getting Started @@ -30,19 +38,19 @@ Raven.configure do |config| config.dsn = 'http://public:secret@example.com/project-id' end ``` -### Raven doesn't report some kinds of data by default. +### Raven doesn't report some kinds of data by default -Raven ignores some exceptions by default - most of these are related to 404s or controller actions not being found. [For a complete list, see the `IGNORE_DEFAULT` constant](https://github.com/getsentry/raven-ruby/blob/master/lib/raven/configuration.rb). +**Raven ignores some exceptions by default** - most of these are related to 404s or controller actions not being found. [For a complete list, see the `IGNORE_DEFAULT` constant](https://github.com/getsentry/raven-ruby/blob/master/lib/raven/configuration.rb). Raven doesn't report POST data or cookies by default. In addition, it will attempt to remove any obviously sensitive data, such as credit card or Social Security numbers. For more information about how Sentry processes your data, [check out the documentation on the `processors` config setting.](https://docs.getsentry.com/hosted/clients/ruby/config/) -### Call +### Usage -If you use Rails, you're already done - no more configuration required! Check [Integrations](https://docs.getsentry.com/hosted/clients/ruby/integrations/) for more details on other gems Sentry integrates with automatically. +**If you use Rails, you're already done - no more configuration required!** Check [Integrations](https://docs.getsentry.com/hosted/clients/ruby/integrations/) for more details on other gems Sentry integrates with automatically. Otherwise, Raven supports two methods of capturing exceptions: ```ruby Raven.capture do @@ -59,33 +67,10 @@ ### More configuration You're all set - but there's a few more settings you may want to know about too! -#### DSN - -While we advise that you set your Sentry DSN through the `SENTRY_DSN` environment -variable, there are two other configuration settings for controlling Raven: - -```ruby -# DSN can be configured as a config setting instead. -# Place in config/initializers or similar. -Raven.configure do |config| - config.dsn = 'your_dsn' -end -``` - -And, while not necessary if using `SENTRY_DSN`, you can also provide an `environments` -setting. Raven will only capture events when `RACK_ENV` or `RAILS_ENV` matches -an environment in the list. - -```ruby -Raven.configure do |config| - config.environments = %w[staging production] -end -``` - #### async When an error or message occurs, the notification is immediately sent to Sentry. Raven can be configured to send asynchronously: ```ruby @@ -94,19 +79,19 @@ } ``` Using a thread to send events will be adequate for truly parallel Ruby platforms such as JRuby, though the benefit on MRI/CRuby will be limited. If the async callback raises an exception, Raven will attempt to send synchronously. -We recommend creating a background job, using your background job processor, that will send Sentry notifications in the background. Rather than enqueuing an entire Raven::Event object, we recommend providing the Hash representation of an event as a job argument. Here’s an example for ActiveJob: +Note that the naive example implementation has a major drawback - it can create an infinite number of threads. We recommend creating a background job, using your background job processor, that will send Sentry notifications in the background. ```ruby config.async = lambda { |event| SentryJob.perform_later(event) } class SentryJob < ActiveJob::Base queue_as :default - - # Important! Otherwise, we can get caught in an infinite loop. + + # Important for ActiveJob! Otherwise, we can get caught in an infinite loop. rescue_from(ActiveJob::DeserializationError) { |e| Rails.logger.error e } def perform(event) Raven.send_event(event) end @@ -144,8 +129,7 @@ ## More Information * [Documentation](https://docs.getsentry.com/hosted/clients/ruby/) * [Bug Tracker](https://github.com/getsentry/raven-ruby/issues) -* [Code](https://github.com/getsentry/raven-ruby) -* [Mailing List](https://groups.google.com/group/getsentry) +* [Forum](https://forum.sentry.io/) * [IRC](irc://irc.freenode.net/sentry>) (irc.freenode.net, #sentry)