sentry-raven 2.7.4 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.craft.yml +15 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- data/.github/pull_request_template.md +16 -0
- data/.github/workflows/test.yml +92 -0
- data/.github/workflows/zeus_upload.yml +32 -0
- data/.gitignore +3 -1
- data/.gitmodules +0 -3
- data/.rubocop.yml +50 -12
- data/.scripts/bump-version.sh +9 -0
- data/{changelog.md → CHANGELOG.md} +238 -1
- data/CONTRIBUTING.md +71 -0
- data/Gemfile +21 -26
- data/README.md +42 -22
- data/lib/raven/backtrace.rb +9 -5
- data/lib/raven/base.rb +8 -3
- data/lib/raven/breadcrumbs.rb +1 -1
- data/lib/raven/breadcrumbs/{activesupport.rb → active_support_logger.rb} +9 -3
- data/lib/raven/breadcrumbs/logger.rb +2 -92
- data/lib/raven/breadcrumbs/sentry_logger.rb +73 -0
- data/lib/raven/cli.rb +10 -21
- data/lib/raven/client.rb +37 -11
- data/lib/raven/configuration.rb +141 -20
- data/lib/raven/context.rb +13 -8
- data/lib/raven/core_ext/object/deep_dup.rb +57 -0
- data/lib/raven/core_ext/object/duplicable.rb +153 -0
- data/lib/raven/event.rb +29 -37
- data/lib/raven/helpers/deprecation_helper.rb +17 -0
- data/lib/raven/instance.rb +30 -8
- data/lib/raven/integrations/delayed_job.rb +16 -16
- data/lib/raven/integrations/rack-timeout.rb +7 -4
- data/lib/raven/integrations/rack.rb +19 -5
- data/lib/raven/integrations/rails.rb +13 -3
- data/lib/raven/integrations/rails/active_job.rb +11 -7
- data/lib/raven/integrations/rails/backtrace_cleaner.rb +29 -0
- data/lib/raven/integrations/rails/controller_transaction.rb +1 -1
- data/lib/raven/integrations/rails/overrides/debug_exceptions_catcher.rb +2 -2
- data/lib/raven/integrations/sidekiq.rb +4 -78
- data/lib/raven/integrations/sidekiq/cleanup_middleware.rb +13 -0
- data/lib/raven/integrations/sidekiq/error_handler.rb +38 -0
- data/lib/raven/interface.rb +2 -2
- data/lib/raven/interfaces/stack_trace.rb +1 -1
- data/lib/raven/linecache.rb +5 -2
- data/lib/raven/logger.rb +3 -2
- data/lib/raven/processor/cookies.rb +16 -6
- data/lib/raven/processor/post_data.rb +2 -0
- data/lib/raven/processor/removecircularreferences.rb +3 -1
- data/lib/raven/processor/sanitizedata.rb +65 -17
- data/lib/raven/processor/utf8conversion.rb +3 -1
- data/lib/raven/transports.rb +4 -0
- data/lib/raven/transports/http.rb +5 -7
- data/lib/raven/transports/stdout.rb +20 -0
- data/lib/raven/utils/context_filter.rb +42 -0
- data/lib/raven/utils/exception_cause_chain.rb +20 -0
- data/lib/raven/utils/real_ip.rb +1 -1
- data/lib/raven/version.rb +2 -2
- data/lib/sentry-raven-without-integrations.rb +6 -1
- data/lib/sentry_raven_without_integrations.rb +1 -0
- data/sentry-raven.gemspec +3 -4
- data/sentry-ruby/.gitignore +11 -0
- data/sentry-ruby/.rspec +3 -0
- data/sentry-ruby/.travis.yml +6 -0
- data/sentry-ruby/CODE_OF_CONDUCT.md +74 -0
- data/sentry-ruby/Gemfile +9 -0
- data/sentry-ruby/LICENSE.txt +21 -0
- data/sentry-ruby/README.md +44 -0
- data/sentry-ruby/Rakefile +6 -0
- data/sentry-ruby/bin/console +14 -0
- data/sentry-ruby/bin/setup +8 -0
- data/sentry-ruby/examples/rails-6.0/.browserslistrc +1 -0
- data/sentry-ruby/examples/rails-6.0/.gitignore +35 -0
- data/sentry-ruby/examples/rails-6.0/Gemfile +58 -0
- data/sentry-ruby/examples/rails-6.0/README.md +23 -0
- data/sentry-ruby/examples/rails-6.0/Rakefile +6 -0
- data/sentry-ruby/examples/rails-6.0/app/assets/config/manifest.js +2 -0
- data/sentry-ruby/examples/rails-6.0/app/assets/images/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/app/assets/stylesheets/application.css +15 -0
- data/sentry-ruby/examples/rails-6.0/app/channels/application_cable/channel.rb +4 -0
- data/sentry-ruby/examples/rails-6.0/app/channels/application_cable/connection.rb +4 -0
- data/sentry-ruby/examples/rails-6.0/app/controllers/application_controller.rb +2 -0
- data/sentry-ruby/examples/rails-6.0/app/controllers/concerns/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/app/controllers/welcome_controller.rb +23 -0
- data/sentry-ruby/examples/rails-6.0/app/helpers/application_helper.rb +2 -0
- data/sentry-ruby/examples/rails-6.0/app/javascript/channels/consumer.js +6 -0
- data/sentry-ruby/examples/rails-6.0/app/javascript/channels/index.js +5 -0
- data/sentry-ruby/examples/rails-6.0/app/javascript/packs/application.js +17 -0
- data/sentry-ruby/examples/rails-6.0/app/jobs/application_job.rb +7 -0
- data/sentry-ruby/examples/rails-6.0/app/mailers/application_mailer.rb +4 -0
- data/sentry-ruby/examples/rails-6.0/app/models/application_record.rb +3 -0
- data/sentry-ruby/examples/rails-6.0/app/models/concerns/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/app/views/layouts/application.html.erb +15 -0
- data/sentry-ruby/examples/rails-6.0/app/views/layouts/mailer.html.erb +13 -0
- data/sentry-ruby/examples/rails-6.0/app/views/layouts/mailer.text.erb +1 -0
- data/sentry-ruby/examples/rails-6.0/app/views/welcome/report_demo.html.erb +22 -0
- data/sentry-ruby/examples/rails-6.0/app/views/welcome/view_error.html.erb +1 -0
- data/sentry-ruby/examples/rails-6.0/app/workers/error_worker.rb +7 -0
- data/sentry-ruby/examples/rails-6.0/babel.config.js +72 -0
- data/sentry-ruby/examples/rails-6.0/bin/bundle +114 -0
- data/sentry-ruby/examples/rails-6.0/bin/rails +9 -0
- data/sentry-ruby/examples/rails-6.0/bin/rake +9 -0
- data/sentry-ruby/examples/rails-6.0/bin/setup +36 -0
- data/sentry-ruby/examples/rails-6.0/bin/spring +17 -0
- data/sentry-ruby/examples/rails-6.0/bin/webpack +18 -0
- data/sentry-ruby/examples/rails-6.0/bin/webpack-dev-server +18 -0
- data/sentry-ruby/examples/rails-6.0/bin/yarn +11 -0
- data/sentry-ruby/examples/rails-6.0/config.ru +5 -0
- data/sentry-ruby/examples/rails-6.0/config/application.rb +28 -0
- data/sentry-ruby/examples/rails-6.0/config/boot.rb +4 -0
- data/sentry-ruby/examples/rails-6.0/config/cable.yml +10 -0
- data/sentry-ruby/examples/rails-6.0/config/credentials.yml.enc +1 -0
- data/sentry-ruby/examples/rails-6.0/config/database.yml +25 -0
- data/sentry-ruby/examples/rails-6.0/config/environment.rb +5 -0
- data/sentry-ruby/examples/rails-6.0/config/environments/development.rb +62 -0
- data/sentry-ruby/examples/rails-6.0/config/environments/production.rb +112 -0
- data/sentry-ruby/examples/rails-6.0/config/environments/test.rb +48 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/application_controller_renderer.rb +8 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/assets.rb +14 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/backtrace_silencers.rb +7 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/content_security_policy.rb +30 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/cookies_serializer.rb +5 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/filter_parameter_logging.rb +4 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/inflections.rb +16 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/mime_types.rb +4 -0
- data/sentry-ruby/examples/rails-6.0/config/initializers/wrap_parameters.rb +14 -0
- data/sentry-ruby/examples/rails-6.0/config/locales/en.yml +33 -0
- data/sentry-ruby/examples/rails-6.0/config/puma.rb +38 -0
- data/sentry-ruby/examples/rails-6.0/config/routes.rb +10 -0
- data/sentry-ruby/examples/rails-6.0/config/spring.rb +6 -0
- data/sentry-ruby/examples/rails-6.0/config/storage.yml +34 -0
- data/sentry-ruby/examples/rails-6.0/config/webpack/development.js +5 -0
- data/sentry-ruby/examples/rails-6.0/config/webpack/environment.js +3 -0
- data/sentry-ruby/examples/rails-6.0/config/webpack/production.js +5 -0
- data/sentry-ruby/examples/rails-6.0/config/webpack/test.js +5 -0
- data/sentry-ruby/examples/rails-6.0/config/webpacker.yml +96 -0
- data/sentry-ruby/examples/rails-6.0/db/seeds.rb +7 -0
- data/sentry-ruby/examples/rails-6.0/lib/assets/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/lib/tasks/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/package.json +15 -0
- data/sentry-ruby/examples/rails-6.0/postcss.config.js +12 -0
- data/sentry-ruby/examples/rails-6.0/public/404.html +67 -0
- data/sentry-ruby/examples/rails-6.0/public/422.html +67 -0
- data/sentry-ruby/examples/rails-6.0/public/500.html +66 -0
- data/sentry-ruby/examples/rails-6.0/public/apple-touch-icon-precomposed.png +0 -0
- data/sentry-ruby/examples/rails-6.0/public/apple-touch-icon.png +0 -0
- data/sentry-ruby/examples/rails-6.0/public/favicon.ico +0 -0
- data/sentry-ruby/examples/rails-6.0/public/robots.txt +1 -0
- data/sentry-ruby/examples/rails-6.0/storage/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/application_system_test_case.rb +5 -0
- data/sentry-ruby/examples/rails-6.0/test/channels/application_cable/connection_test.rb +11 -0
- data/sentry-ruby/examples/rails-6.0/test/controllers/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/fixtures/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/fixtures/files/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/helpers/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/integration/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/mailers/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/models/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/system/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/test/test_helper.rb +13 -0
- data/sentry-ruby/examples/rails-6.0/vendor/.keep +0 -0
- data/sentry-ruby/examples/rails-6.0/yarn.lock +7508 -0
- data/sentry-ruby/lib/sentry.rb +16 -0
- data/sentry-ruby/lib/sentry/backtrace.rb +128 -0
- data/sentry-ruby/lib/sentry/client.rb +162 -0
- data/sentry-ruby/lib/sentry/client/state.rb +40 -0
- data/sentry-ruby/lib/sentry/configuration.rb +533 -0
- data/sentry-ruby/lib/sentry/event.rb +209 -0
- data/sentry-ruby/lib/sentry/interface.rb +31 -0
- data/sentry-ruby/lib/sentry/interfaces/exception.rb +15 -0
- data/sentry-ruby/lib/sentry/interfaces/http.rb +16 -0
- data/sentry-ruby/lib/sentry/interfaces/message.rb +18 -0
- data/sentry-ruby/lib/sentry/interfaces/single_exception.rb +14 -0
- data/sentry-ruby/lib/sentry/interfaces/stack_trace.rb +69 -0
- data/sentry-ruby/lib/sentry/linecache.rb +44 -0
- data/sentry-ruby/lib/sentry/logger.rb +20 -0
- data/sentry-ruby/lib/sentry/transports.rb +19 -0
- data/sentry-ruby/lib/sentry/transports/dummy.rb +16 -0
- data/sentry-ruby/lib/sentry/transports/http.rb +66 -0
- data/sentry-ruby/lib/sentry/transports/stdout.rb +20 -0
- data/sentry-ruby/lib/sentry/utils/deep_merge.rb +22 -0
- data/sentry-ruby/lib/sentry/utils/exception_cause_chain.rb +20 -0
- data/sentry-ruby/lib/sentry/version.rb +3 -0
- data/sentry-ruby/sentry-ruby.gemspec +26 -0
- data/sentry-ruby/spec/sentry/backtrace_spec.rb +38 -0
- data/sentry-ruby/spec/sentry/client_spec.rb +443 -0
- data/sentry-ruby/spec/sentry/configuration_spec.rb +400 -0
- data/sentry-ruby/spec/sentry/event_spec.rb +238 -0
- data/sentry-ruby/spec/sentry/interface_spec.rb +38 -0
- data/sentry-ruby/spec/sentry/interfaces/stack_trace_spec.rb +11 -0
- data/sentry-ruby/spec/sentry/linecache_spec.rb +40 -0
- data/sentry-ruby/spec/sentry/transports/http_spec.rb +57 -0
- data/sentry-ruby/spec/sentry/transports/stdout_spec.rb +11 -0
- data/sentry-ruby/spec/sentry_spec.rb +9 -0
- data/sentry-ruby/spec/spec_helper.rb +49 -0
- data/sentry-ruby/spec/support/linecache.txt +6 -0
- metadata +160 -31
- data/.travis.yml +0 -47
- data/docs/Makefile +0 -130
- data/docs/breadcrumbs.rst +0 -51
- data/docs/conf.py +0 -228
- data/docs/config.rst +0 -260
- data/docs/context.rst +0 -141
- data/docs/index.rst +0 -113
- data/docs/install.rst +0 -40
- data/docs/integrations/heroku.rst +0 -11
- data/docs/integrations/index.rst +0 -59
- data/docs/integrations/puma.rst +0 -30
- data/docs/integrations/rack.rst +0 -27
- data/docs/integrations/rails.rst +0 -62
- data/docs/make.bat +0 -155
- data/docs/processors.rst +0 -124
- data/docs/sentry-doc-config.json +0 -31
- data/docs/usage.rst +0 -176
data/docs/install.rst
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
Installation
|
2
|
-
============
|
3
|
-
|
4
|
-
Raven Ruby comes as a gem and is straightforward to install. If you are
|
5
|
-
using Bundler just add this to your ``Gemfile``:
|
6
|
-
|
7
|
-
.. sourcecode:: ruby
|
8
|
-
|
9
|
-
gem "sentry-raven"
|
10
|
-
|
11
|
-
Development Version
|
12
|
-
-------------------
|
13
|
-
|
14
|
-
If you want to install the development version from github:
|
15
|
-
|
16
|
-
.. sourcecode:: ruby
|
17
|
-
|
18
|
-
gem "sentry-raven", :github => "getsentry/raven-ruby"
|
19
|
-
|
20
|
-
Without Integrations
|
21
|
-
--------------------
|
22
|
-
|
23
|
-
If you wish to activate integrations manually (or don't want them
|
24
|
-
activated by default), require "raven/base" instead of "raven" or
|
25
|
-
"sentry-raven". In that case disable the requiring in the ``Gemfile``:
|
26
|
-
|
27
|
-
.. sourcecode:: ruby
|
28
|
-
|
29
|
-
gem "sentry-raven", :require => false
|
30
|
-
|
31
|
-
And in your initialization code:
|
32
|
-
|
33
|
-
.. sourcecode:: ruby
|
34
|
-
|
35
|
-
require "raven/base"
|
36
|
-
require "raven/integrations/rails"
|
37
|
-
require "raven/integrations/delayed_job"
|
38
|
-
|
39
|
-
This stops you from calling ``Raven.inject``, which is where all this
|
40
|
-
integration loading occurs.
|
data/docs/integrations/index.rst
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
Integrations
|
2
|
-
============
|
3
|
-
|
4
|
-
For common environments and frameworks like Rails, Rake, Rack and others
|
5
|
-
Ruby Raven provides automatic integration for reporting. Most of the time
|
6
|
-
you don't need to change anything, although you can configure those
|
7
|
-
features if you want.
|
8
|
-
|
9
|
-
.. toctree::
|
10
|
-
:maxdepth: 1
|
11
|
-
|
12
|
-
rails
|
13
|
-
rack
|
14
|
-
puma
|
15
|
-
heroku
|
16
|
-
|
17
|
-
The following integrations are available:
|
18
|
-
|
19
|
-
* Sidekiq (``:sidekiq``)
|
20
|
-
* ``Delayed::Job`` (``:delayed_job``)
|
21
|
-
* Rake (``:rake``)
|
22
|
-
* Rack (``:rack``)
|
23
|
-
* Rails (``:railties``)
|
24
|
-
|
25
|
-
|
26
|
-
Manually using integrations
|
27
|
-
---------------------------
|
28
|
-
|
29
|
-
Integrations are automatically loaded by default. This can be problematic if
|
30
|
-
the default integration behavior doesn't suit your projects' needs.
|
31
|
-
|
32
|
-
To explicitly include integrations:
|
33
|
-
|
34
|
-
.. sourcecode:: ruby
|
35
|
-
|
36
|
-
require 'sentry-raven-without-integrations'
|
37
|
-
Raven.inject_only(:railties, :rack, :rake)
|
38
|
-
|
39
|
-
|
40
|
-
To blacklist integrations:
|
41
|
-
|
42
|
-
.. sourcecode:: ruby
|
43
|
-
|
44
|
-
require 'sentry-raven-without-integrations'
|
45
|
-
Raven.inject_without(:sidekiq, :delayed_job)
|
46
|
-
|
47
|
-
|
48
|
-
If you're using bundler, then in your gemfile:
|
49
|
-
|
50
|
-
.. sourcecode:: ruby
|
51
|
-
|
52
|
-
gem 'sentry-raven', require: 'sentry-raven-without-integrations'
|
53
|
-
|
54
|
-
|
55
|
-
And in some sort of initializer:
|
56
|
-
|
57
|
-
.. sourcecode:: ruby
|
58
|
-
|
59
|
-
Raven.inject_without(:sidekiq)
|
data/docs/integrations/puma.rst
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
Puma
|
2
|
-
====
|
3
|
-
|
4
|
-
Installation
|
5
|
-
------------
|
6
|
-
|
7
|
-
Install the SDK via Rubygems by adding it to your ``Gemfile``:
|
8
|
-
|
9
|
-
.. sourcecode:: ruby
|
10
|
-
|
11
|
-
gem "sentry-raven"
|
12
|
-
|
13
|
-
Configuration
|
14
|
-
-------------
|
15
|
-
|
16
|
-
Puma provides a config option for handling low level errors.
|
17
|
-
|
18
|
-
.. sourcecode:: ruby
|
19
|
-
|
20
|
-
# in your puma.rb config
|
21
|
-
lowlevel_error_handler do |ex, env|
|
22
|
-
Raven.capture_exception(
|
23
|
-
ex,
|
24
|
-
:message => ex.message,
|
25
|
-
:extra => { :puma => env },
|
26
|
-
:transaction => "Puma"
|
27
|
-
)
|
28
|
-
# note the below is just a Rack response
|
29
|
-
[500, {}, ["An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact support@example.com\n"]]
|
30
|
-
end
|
data/docs/integrations/rack.rst
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
Rack (Sinatra etc.)
|
2
|
-
===================
|
3
|
-
|
4
|
-
Installation
|
5
|
-
------------
|
6
|
-
|
7
|
-
Install the SDK via Rubygems by adding it to your ``Gemfile``:
|
8
|
-
|
9
|
-
.. sourcecode:: ruby
|
10
|
-
|
11
|
-
gem "sentry-raven"
|
12
|
-
|
13
|
-
Configuration
|
14
|
-
-------------
|
15
|
-
|
16
|
-
Add ``use Raven::Rack`` to your ``config.ru`` or other rackup file (this is
|
17
|
-
automatically inserted in Rails):
|
18
|
-
|
19
|
-
.. sourcecode:: ruby
|
20
|
-
|
21
|
-
require 'raven'
|
22
|
-
|
23
|
-
Raven.configure do |config|
|
24
|
-
config.dsn = '___DSN___'
|
25
|
-
end
|
26
|
-
|
27
|
-
use Raven::Rack
|
data/docs/integrations/rails.rst
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
Ruby on Rails
|
2
|
-
=============
|
3
|
-
|
4
|
-
In Rails, all uncaught exceptions will be automatically reported.
|
5
|
-
|
6
|
-
We support Rails 4 and newer.
|
7
|
-
|
8
|
-
Installation
|
9
|
-
------------
|
10
|
-
|
11
|
-
Install the SDK via Rubygems by adding it to your ``Gemfile``:
|
12
|
-
|
13
|
-
.. sourcecode:: ruby
|
14
|
-
|
15
|
-
gem "sentry-raven"
|
16
|
-
|
17
|
-
Configuration
|
18
|
-
-------------
|
19
|
-
|
20
|
-
Open up ``config/application.rb`` and configure the DSN, and any other :doc:`settings <../config>`
|
21
|
-
you need:
|
22
|
-
|
23
|
-
.. sourcecode:: ruby
|
24
|
-
|
25
|
-
Raven.configure do |config|
|
26
|
-
config.dsn = '___DSN___'
|
27
|
-
end
|
28
|
-
|
29
|
-
If you have added items to `Rails' log filtering
|
30
|
-
<http://guides.rubyonrails.org/action_controller_overview.html#parameters-filtering>`_,
|
31
|
-
you can also make sure that those items are not sent to Sentry:
|
32
|
-
|
33
|
-
.. sourcecode:: ruby
|
34
|
-
|
35
|
-
# in your application.rb:
|
36
|
-
config.filter_parameters << :password
|
37
|
-
|
38
|
-
# in an initializer, like sentry.rb
|
39
|
-
Raven.configure do |config|
|
40
|
-
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
|
41
|
-
end
|
42
|
-
|
43
|
-
Params and sessions
|
44
|
-
-------------------
|
45
|
-
|
46
|
-
.. sourcecode:: ruby
|
47
|
-
|
48
|
-
class ApplicationController < ActionController::Base
|
49
|
-
before_action :set_raven_context
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
def set_raven_context
|
54
|
-
Raven.user_context(id: session[:current_user_id]) # or anything else in session
|
55
|
-
Raven.extra_context(params: params.to_unsafe_h, url: request.url)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
Caveats
|
60
|
-
-------
|
61
|
-
|
62
|
-
Currently, custom exception applications (`config.exceptions_app`) are not supported. If you are using a custom exception app, you must manually integrate Raven yourself.
|
data/docs/make.bat
DELETED
@@ -1,155 +0,0 @@
|
|
1
|
-
@ECHO OFF
|
2
|
-
|
3
|
-
REM Command file for Sphinx documentation
|
4
|
-
|
5
|
-
if "%SPHINXBUILD%" == "" (
|
6
|
-
set SPHINXBUILD=sphinx-build
|
7
|
-
)
|
8
|
-
set BUILDDIR=_build
|
9
|
-
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
10
|
-
if NOT "%PAPER%" == "" (
|
11
|
-
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
12
|
-
)
|
13
|
-
|
14
|
-
if "%1" == "" goto help
|
15
|
-
|
16
|
-
if "%1" == "help" (
|
17
|
-
:help
|
18
|
-
echo.Please use `make ^<target^>` where ^<target^> is one of
|
19
|
-
echo. html to make standalone HTML files
|
20
|
-
echo. dirhtml to make HTML files named index.html in directories
|
21
|
-
echo. singlehtml to make a single large HTML file
|
22
|
-
echo. pickle to make pickle files
|
23
|
-
echo. json to make JSON files
|
24
|
-
echo. htmlhelp to make HTML files and a HTML help project
|
25
|
-
echo. qthelp to make HTML files and a qthelp project
|
26
|
-
echo. devhelp to make HTML files and a Devhelp project
|
27
|
-
echo. epub to make an epub
|
28
|
-
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
29
|
-
echo. text to make text files
|
30
|
-
echo. man to make manual pages
|
31
|
-
echo. changes to make an overview over all changed/added/deprecated items
|
32
|
-
echo. linkcheck to check all external links for integrity
|
33
|
-
echo. doctest to run all doctests embedded in the documentation if enabled
|
34
|
-
goto end
|
35
|
-
)
|
36
|
-
|
37
|
-
if "%1" == "clean" (
|
38
|
-
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
39
|
-
del /q /s %BUILDDIR%\*
|
40
|
-
goto end
|
41
|
-
)
|
42
|
-
|
43
|
-
if "%1" == "html" (
|
44
|
-
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
45
|
-
echo.
|
46
|
-
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
47
|
-
goto end
|
48
|
-
)
|
49
|
-
|
50
|
-
if "%1" == "dirhtml" (
|
51
|
-
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
52
|
-
echo.
|
53
|
-
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
54
|
-
goto end
|
55
|
-
)
|
56
|
-
|
57
|
-
if "%1" == "singlehtml" (
|
58
|
-
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
59
|
-
echo.
|
60
|
-
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
61
|
-
goto end
|
62
|
-
)
|
63
|
-
|
64
|
-
if "%1" == "pickle" (
|
65
|
-
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
66
|
-
echo.
|
67
|
-
echo.Build finished; now you can process the pickle files.
|
68
|
-
goto end
|
69
|
-
)
|
70
|
-
|
71
|
-
if "%1" == "json" (
|
72
|
-
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
73
|
-
echo.
|
74
|
-
echo.Build finished; now you can process the JSON files.
|
75
|
-
goto end
|
76
|
-
)
|
77
|
-
|
78
|
-
if "%1" == "htmlhelp" (
|
79
|
-
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
80
|
-
echo.
|
81
|
-
echo.Build finished; now you can run HTML Help Workshop with the ^
|
82
|
-
.hhp project file in %BUILDDIR%/htmlhelp.
|
83
|
-
goto end
|
84
|
-
)
|
85
|
-
|
86
|
-
if "%1" == "qthelp" (
|
87
|
-
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
88
|
-
echo.
|
89
|
-
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
90
|
-
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
91
|
-
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Sentry.qhcp
|
92
|
-
echo.To view the help file:
|
93
|
-
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Sentry.ghc
|
94
|
-
goto end
|
95
|
-
)
|
96
|
-
|
97
|
-
if "%1" == "devhelp" (
|
98
|
-
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
99
|
-
echo.
|
100
|
-
echo.Build finished.
|
101
|
-
goto end
|
102
|
-
)
|
103
|
-
|
104
|
-
if "%1" == "epub" (
|
105
|
-
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
106
|
-
echo.
|
107
|
-
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
108
|
-
goto end
|
109
|
-
)
|
110
|
-
|
111
|
-
if "%1" == "latex" (
|
112
|
-
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
113
|
-
echo.
|
114
|
-
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
115
|
-
goto end
|
116
|
-
)
|
117
|
-
|
118
|
-
if "%1" == "text" (
|
119
|
-
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
120
|
-
echo.
|
121
|
-
echo.Build finished. The text files are in %BUILDDIR%/text.
|
122
|
-
goto end
|
123
|
-
)
|
124
|
-
|
125
|
-
if "%1" == "man" (
|
126
|
-
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
127
|
-
echo.
|
128
|
-
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
129
|
-
goto end
|
130
|
-
)
|
131
|
-
|
132
|
-
if "%1" == "changes" (
|
133
|
-
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
134
|
-
echo.
|
135
|
-
echo.The overview file is in %BUILDDIR%/changes.
|
136
|
-
goto end
|
137
|
-
)
|
138
|
-
|
139
|
-
if "%1" == "linkcheck" (
|
140
|
-
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
141
|
-
echo.
|
142
|
-
echo.Link check complete; look for any errors in the above output ^
|
143
|
-
or in %BUILDDIR%/linkcheck/output.txt.
|
144
|
-
goto end
|
145
|
-
)
|
146
|
-
|
147
|
-
if "%1" == "doctest" (
|
148
|
-
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
149
|
-
echo.
|
150
|
-
echo.Testing of doctests in the sources finished, look at the ^
|
151
|
-
results in %BUILDDIR%/doctest/output.txt.
|
152
|
-
goto end
|
153
|
-
)
|
154
|
-
|
155
|
-
:end
|
data/docs/processors.rst
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
Processors
|
2
|
-
==========
|
3
|
-
|
4
|
-
Raven Ruby contains several "processors", which scrub data before it is sent to Sentry.
|
5
|
-
Processors remove invalid or sensitive data. The following are the processors
|
6
|
-
which are enabled by default (and are applied to all outgoing data in this order):
|
7
|
-
|
8
|
-
RemoveCircularReferences
|
9
|
-
Many Ruby JSON implementations simply throw an exception if they detect a
|
10
|
-
circular reference. This processor removes circular references from hashes
|
11
|
-
and arrays.
|
12
|
-
|
13
|
-
UTF8Conversion
|
14
|
-
Many Ruby JSON implementations will throw exceptions if data is not in a
|
15
|
-
consistent UTF-8 format. This processor looks for invalid encodings and fixes
|
16
|
-
them.
|
17
|
-
|
18
|
-
SanitizeData
|
19
|
-
Censors any data which looks like a password, social security number or credit
|
20
|
-
card number. Can be configured to scrub other data.
|
21
|
-
|
22
|
-
Cookies
|
23
|
-
Removes any HTTP cookies from the Sentry event data.
|
24
|
-
|
25
|
-
PostData
|
26
|
-
Removes any HTTP Post request bodies.
|
27
|
-
|
28
|
-
HTTPHeaders
|
29
|
-
Removes all HTTP headers which match a regex. By default, this will only remove the
|
30
|
-
"Authorization" header, but can be configured to remove others.
|
31
|
-
|
32
|
-
Finally, another processor is included in the source but is not turned on by default,
|
33
|
-
RemoveStackTrace.
|
34
|
-
|
35
|
-
To remove stacktraces from events:
|
36
|
-
|
37
|
-
.. sourcecode:: ruby
|
38
|
-
|
39
|
-
Raven.configure do |config|
|
40
|
-
config.processors += [Raven::Processor::RemoveStacktrace]
|
41
|
-
end
|
42
|
-
|
43
|
-
Writing Your Own Processor
|
44
|
-
--------------------------
|
45
|
-
|
46
|
-
Processors are simple to write and understand. As an example, let's say that we
|
47
|
-
send user API keys to a background job (using Sidekiq), and if the background job
|
48
|
-
raises an exception, we want to make sure that the API key is removed from the
|
49
|
-
event data.
|
50
|
-
|
51
|
-
This is what a basic processor might look like:
|
52
|
-
|
53
|
-
.. sourcecode:: ruby
|
54
|
-
|
55
|
-
class MyJobProcessor < Raven::Processor
|
56
|
-
def process(data)
|
57
|
-
return data unless data["extra"]["arguments"] &&
|
58
|
-
data["extra"]["arguments"].first["sensitive_parameter"]
|
59
|
-
|
60
|
-
data["extra"]["arguments"].first["sensitive_parameter"] = STRING_MASK
|
61
|
-
data
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
Processors should inherit from the ``Raven::Processor`` class. This ensures that the
|
66
|
-
processor has access to its client (all processors have a ``client`` instance method,
|
67
|
-
which will be populated with the current ``Raven::Client`` when the processor
|
68
|
-
is initialized), and gives you a few convenient constants for masking data.
|
69
|
-
|
70
|
-
Processors must have a method called ``process`` defined. It must accept one
|
71
|
-
argument, which will be the Raven event data hash. The method must return a hash,
|
72
|
-
which represents the data after it has been modified by the processor.
|
73
|
-
|
74
|
-
To help you in writing your own processor, here is what the Event data hash looks
|
75
|
-
like (slightly modified/concatenated) when it is passed to the processor:
|
76
|
-
|
77
|
-
.. sourcecode:: ruby
|
78
|
-
|
79
|
-
{
|
80
|
-
"environment" => "default",
|
81
|
-
"event_id" => "02ea6d3d35c840b1a8f339ba896917e3",
|
82
|
-
"extra" => {
|
83
|
-
"server" => {
|
84
|
-
# server related information
|
85
|
-
}
|
86
|
-
"active_job" => "MyActiveJob",
|
87
|
-
"arguments" => [ {"sensitive_parameter": "sensitive"} ],
|
88
|
-
"job_id" => "cbc2c146-0486-4e98-b81c-1a251d636b34",
|
89
|
-
},
|
90
|
-
"modules" => {
|
91
|
-
"rake"=>"12.0.0",
|
92
|
-
"concurrent-ruby"=>"1.0.5",
|
93
|
-
"i18n"=>"0.8.6",
|
94
|
-
"minitest"=>"5.10.3",
|
95
|
-
# ...
|
96
|
-
},
|
97
|
-
"platform" => "ruby",
|
98
|
-
"release" => "e4d5ced",
|
99
|
-
"sdk" => {"name"=>"raven-ruby", "version"=>"2.6.3"},
|
100
|
-
"server_name" => "myserver.local",
|
101
|
-
"timestamp" => "2017-10-09T19:53:20",
|
102
|
-
"exception" => {
|
103
|
-
# A very large and complex exception object
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
However, it will probably be more helpful if you use a debugger, such as `pry`, to
|
108
|
-
inspect the event data hash for yourself.
|
109
|
-
|
110
|
-
The example processor given above looks for the ActiveJob arguments hash, looks for
|
111
|
-
a particular value, and then replaces it with the string mask. There is a fast return
|
112
|
-
if the event does not contain the ActiveJob data we're looking for, using Ruby 2.3+'s
|
113
|
-
safe navigation operator.
|
114
|
-
|
115
|
-
Once you have your processor written, you simply need to add it to the processor chain:
|
116
|
-
|
117
|
-
.. sourcecode:: ruby
|
118
|
-
|
119
|
-
Raven.configure do |config|
|
120
|
-
config.processors += MyJobProcessor
|
121
|
-
end
|
122
|
-
|
123
|
-
For more information about writing processors, read the code for the default
|
124
|
-
processors, located in ``lib/processor``.
|