sentry-raven 2.5.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/docs/Makefile ADDED
@@ -0,0 +1,130 @@
1
+ # Makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = sphinx-build
7
+ PAPER =
8
+ BUILDDIR = ./_build
9
+
10
+ # Internal variables.
11
+ PAPEROPT_a4 = -D latex_paper_size=a4
12
+ PAPEROPT_letter = -D latex_paper_size=letter
13
+ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
14
+
15
+ .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
16
+
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 " latexpdf to make LaTeX files and run them through pdflatex"
30
+ @echo " text to make text files"
31
+ @echo " man to make manual pages"
32
+ @echo " changes to make an overview of all changed/added/deprecated items"
33
+ @echo " linkcheck to check all external links for integrity"
34
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
35
+
36
+ clean:
37
+ -rm -rf $(BUILDDIR)/*
38
+
39
+ html:
40
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
41
+ @echo
42
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
43
+
44
+ dirhtml:
45
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
46
+ @echo
47
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
48
+
49
+ singlehtml:
50
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
51
+ @echo
52
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
53
+
54
+ pickle:
55
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
56
+ @echo
57
+ @echo "Build finished; now you can process the pickle files."
58
+
59
+ json:
60
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
61
+ @echo
62
+ @echo "Build finished; now you can process the JSON files."
63
+
64
+ htmlhelp:
65
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
66
+ @echo
67
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
68
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
69
+
70
+ qthelp:
71
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
72
+ @echo
73
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
74
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
75
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Sentry.qhcp"
76
+ @echo "To view the help file:"
77
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Sentry.qhc"
78
+
79
+ devhelp:
80
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
81
+ @echo
82
+ @echo "Build finished."
83
+ @echo "To view the help file:"
84
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/Sentry"
85
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Sentry"
86
+ @echo "# devhelp"
87
+
88
+ epub:
89
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
90
+ @echo
91
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
92
+
93
+ latex:
94
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
95
+ @echo
96
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
97
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
98
+ "(use \`make latexpdf' here to do that automatically)."
99
+
100
+ latexpdf:
101
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
102
+ @echo "Running LaTeX files through pdflatex..."
103
+ make -C $(BUILDDIR)/latex all-pdf
104
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
105
+
106
+ text:
107
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
108
+ @echo
109
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
110
+
111
+ man:
112
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
113
+ @echo
114
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
115
+
116
+ changes:
117
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
118
+ @echo
119
+ @echo "The overview file is in $(BUILDDIR)/changes."
120
+
121
+ linkcheck:
122
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
123
+ @echo
124
+ @echo "Link check complete; look for any errors in the above output " \
125
+ "or in $(BUILDDIR)/linkcheck/output.txt."
126
+
127
+ doctest:
128
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
129
+ @echo "Testing of doctests in the sources finished, look at the " \
130
+ "results in $(BUILDDIR)/doctest/output.txt."
@@ -0,0 +1,40 @@
1
+ Breadcrumbs
2
+ ===========
3
+
4
+ Breadcrumbs are a trail of events which happened prior to an issue. Often, these events are very similar to traditional logs, but Breadcrumbs also can record rich, structured data.
5
+
6
+ .. sourcecode:: ruby
7
+
8
+ Raven.breadcrumbs.record do |crumb|
9
+ crumb.data = data
10
+ crumb.category = name
11
+ # ...
12
+ end
13
+
14
+ The following attributes are available:
15
+
16
+ * ``category``: A String to label the event under. This will usually be the same as a logger name, and will let you more easily understand the area an event took place, such as "auth".
17
+ * ``data``: A Hash of metadata around the event. This is often used instead of message, but may also be used in addition.
18
+ * ``level``: The level may be any of ``error``, ``warn``, ``info``, or ``debug``.
19
+ * ``message``: A string describing the event. The most common vector, often used as a drop-in for a traditional log message.
20
+ * ``timestamp``: A Unix timestamp (seconds past epoch)
21
+
22
+ Appropriate places to inject Breadcrumbs may be places like your HTTP library:
23
+
24
+ .. sourcecode:: ruby
25
+
26
+ # Instrumenting Faraday with a middleware:
27
+
28
+ class RavenFaradayMiddleware
29
+ def call
30
+ # Add a breadcrumb every time we complete an HTTP request
31
+ @app.call(request_env).on_complete do |response_env|
32
+ Raven.breadcrumbs.record do |crumb|
33
+ crumb.data = { response_env: response_env }
34
+ crumb.category = "faraday"
35
+ crumb.timestamp = Time.now.to_i
36
+ crumb.message = "Completed request to #{request_env[:url]}"
37
+ end
38
+ end
39
+ end
40
+ end
data/docs/conf.py ADDED
@@ -0,0 +1,228 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Sentry documentation build configuration file, created by
4
+ # sphinx-quickstart on Wed Oct 20 16:21:42 2010.
5
+ #
6
+ # This file is execfile()d with the current directory set to its containing dir.
7
+ #
8
+ # Note that not all possible configuration values are present in this
9
+ # autogenerated file.
10
+ #
11
+ # All configuration values have a default; values that are commented out
12
+ # serve to show the default.
13
+
14
+ import os
15
+ import sys
16
+ import datetime
17
+
18
+ # If extensions (or modules to document with autodoc) are in another directory,
19
+ # add these directories to sys.path here. If the directory is relative to the
20
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
21
+ #sys.path.insert(0, os.path.abspath('.'))
22
+
23
+ # -- General configuration -----------------------------------------------------
24
+
25
+ # If your documentation needs a minimal Sphinx version, state it here.
26
+ #needs_sphinx = '1.0'
27
+
28
+ # Add any Sphinx extension module names here, as strings. They can be extensions
29
+ # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
30
+ #extensions = ['sphinxtogithub']
31
+ extensions = ['sphinx.ext.intersphinx']
32
+
33
+ # Add any paths that contain templates here, relative to this directory.
34
+ templates_path = ['_templates']
35
+
36
+ # The suffix of source filenames.
37
+ source_suffix = '.rst'
38
+
39
+ # The encoding of source files.
40
+ #source_encoding = 'utf-8-sig'
41
+
42
+ # The master toctree document.
43
+ master_doc = 'index'
44
+
45
+ # General information about the project.
46
+ project = u'Raven'
47
+ copyright = u'%s, Functional Software Inc.' % datetime.datetime.today().year
48
+
49
+ # The version info for the project you're documenting, acts as replacement for
50
+ # |version| and |release|, also used in various other places throughout the
51
+ # built documents.
52
+ #
53
+ # The short X.Y version.
54
+
55
+ version = __import__('pkg_resources').get_distribution('raven').version
56
+ # The full version, including alpha/beta/rc tags.
57
+ release = version
58
+
59
+ # The language for content autogenerated by Sphinx. Refer to documentation
60
+ # for a list of supported languages.
61
+ #language = None
62
+
63
+ # There are two options for replacing |today|: either, you set today to some
64
+ # non-false value, then it is used:
65
+ #today = ''
66
+ # Else, today_fmt is used as the format for a strftime call.
67
+ #today_fmt = '%B %d, %Y'
68
+
69
+ # List of patterns, relative to source directory, that match files and
70
+ # directories to ignore when looking for source files.
71
+ exclude_patterns = ['_build']
72
+
73
+ # The reST default role (used for this markup: `text`) to use for all documents.
74
+ #default_role = None
75
+
76
+ # If true, '()' will be appended to :func: etc. cross-reference text.
77
+ #add_function_parentheses = True
78
+
79
+ # If true, the current module name will be prepended to all description
80
+ # unit titles (such as .. function::).
81
+ #add_module_names = True
82
+
83
+ # If true, sectionauthor and moduleauthor directives will be shown in the
84
+ # output. They are ignored by default.
85
+ #show_authors = False
86
+
87
+ # The name of the Pygments (syntax highlighting) style to use.
88
+ pygments_style = 'sphinx'
89
+
90
+ # A list of ignored prefixes for module index sorting.
91
+ #modindex_common_prefix = []
92
+
93
+ intersphinx_mapping = {
94
+ }
95
+
96
+
97
+ # -- Options for HTML output ---------------------------------------------------
98
+
99
+ # The theme to use for HTML and HTML Help pages. See the documentation for
100
+ # a list of builtin themes.
101
+ html_theme = 'nature'
102
+
103
+ # Theme options are theme-specific and customize the look and feel of a theme
104
+ # further. For a list of options available for each theme, see the
105
+ # documentation.
106
+ # html_theme_options = {}
107
+
108
+ # Add any paths that contain custom themes here, relative to this directory.
109
+ html_theme_path = ['_themes']
110
+
111
+ # The name for this set of Sphinx documents. If None, it defaults to
112
+ # "<project> v<release> documentation".
113
+ #html_title = None
114
+
115
+ # A shorter title for the navigation bar. Default is the same as html_title.
116
+ #html_short_title = None
117
+
118
+ # The name of an image file (relative to this directory) to place at the top
119
+ # of the sidebar.
120
+ #html_logo = "_static/logo.png"
121
+
122
+ # The name of an image file (within the static path) to use as favicon of the
123
+ # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
124
+ # pixels large.
125
+ #html_favicon = None
126
+
127
+ # Add any paths that contain custom static files (such as style sheets) here,
128
+ # relative to this directory. They are copied after the builtin static files,
129
+ # so a file named "default.css" will overwrite the builtin "default.css".
130
+ html_static_path = ['_static']
131
+
132
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
133
+ # using the given strftime format.
134
+ #html_last_updated_fmt = '%b %d, %Y'
135
+
136
+ # If true, SmartyPants will be used to convert quotes and dashes to
137
+ # typographically correct entities.
138
+ #html_use_smartypants = True
139
+
140
+ # Custom sidebar templates, maps document names to template names.
141
+ #html_sidebars = {}
142
+
143
+ # Additional templates that should be rendered to pages, maps page names to
144
+ # template names.
145
+ #html_additional_pages = {}
146
+
147
+ # If false, no module index is generated.
148
+ #html_domain_indices = True
149
+
150
+ # If false, no index is generated.
151
+ #html_use_index = True
152
+
153
+ # If true, the index is split into individual pages for each letter.
154
+ #html_split_index = False
155
+
156
+ # If true, links to the reST sources are added to the pages.
157
+ #html_show_sourcelink = True
158
+
159
+ # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
160
+ #html_show_sphinx = True
161
+
162
+ # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
163
+ #html_show_copyright = True
164
+
165
+ # If true, an OpenSearch description file will be output, and all pages will
166
+ # contain a <link> tag referring to it. The value of this option must be the
167
+ # base URL from which the finished HTML is served.
168
+ #html_use_opensearch = ''
169
+
170
+ # This is the file name suffix for HTML files (e.g. ".xhtml").
171
+ #html_file_suffix = None
172
+
173
+ # Output file base name for HTML help builder.
174
+ htmlhelp_basename = 'Ravendoc'
175
+
176
+
177
+ # -- Options for LaTeX output --------------------------------------------------
178
+
179
+ # The paper size ('letter' or 'a4').
180
+ #latex_paper_size = 'letter'
181
+
182
+ # The font size ('10pt', '11pt' or '12pt').
183
+ #latex_font_size = '10pt'
184
+
185
+ # Grouping the document tree into LaTeX files. List of tuples
186
+ # (source start file, target name, title, author, documentclass [howto/manual]).
187
+ latex_documents = [
188
+ ('index', 'Raven.tex', u'Raven Ruby Documentation',
189
+ u'David Cramer', 'manual'),
190
+ ]
191
+
192
+ # The name of an image file (relative to this directory) to place at the top of
193
+ # the title page.
194
+ #latex_logo = None
195
+
196
+ # For "manual" documents, if this is true, then toplevel headings are parts,
197
+ # not chapters.
198
+ #latex_use_parts = False
199
+
200
+ # If true, show page references after internal links.
201
+ #latex_show_pagerefs = False
202
+
203
+ # If true, show URL addresses after external links.
204
+ #latex_show_urls = False
205
+
206
+ # Additional stuff for the LaTeX preamble.
207
+ #latex_preamble = ''
208
+
209
+ # Documents to append as an appendix to all manuals.
210
+ #latex_appendices = []
211
+
212
+ # If false, no module index is generated.
213
+ #latex_domain_indices = True
214
+
215
+
216
+ # -- Options for manual page output --------------------------------------------
217
+
218
+ # One entry per manual page. List of tuples
219
+ # (source start file, name, description, authors, manual section).
220
+ man_pages = [
221
+ ('index', 'raven', u'Raven Ruby Documentation',
222
+ [u'Functional Software Inc.'], 1)
223
+ ]
224
+
225
+ if os.environ.get('SENTRY_FEDERATED_DOCS') != '1':
226
+ sys.path.insert(0, os.path.abspath('_sentryext'))
227
+ import sentryext
228
+ sentryext.activate()
data/docs/config.rst ADDED
@@ -0,0 +1,240 @@
1
+ Configuration
2
+ =============
3
+
4
+ Configuration is passed as part of the client initialization:
5
+
6
+ .. code-block:: javascript
7
+
8
+ Raven.configure do |config|
9
+ config.dsn = '___DSN___'
10
+ config.attr = 'value'
11
+ end
12
+
13
+ Optional settings
14
+ -----------------
15
+
16
+ .. describe:: async
17
+
18
+ When an error or message occurs, the notification is immediately sent to Sentry. Raven can be configured to send asynchronously:
19
+
20
+ .. code-block:: ruby
21
+
22
+ config.async = lambda { |event|
23
+ Thread.new { Raven.send_event(event) }
24
+ }
25
+
26
+ 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. Threads also won't report any exceptions raised inside of them, so be careful!
27
+
28
+ If the async callback raises an exception, Raven will attempt to send synchronously.
29
+
30
+ 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:
31
+
32
+ .. code-block:: ruby
33
+
34
+ config.async = lambda { |event|
35
+ SentryJob.perform_later(event.to_hash)
36
+ }
37
+
38
+ .. code-block:: ruby
39
+
40
+ class SentryJob < ActiveJob::Base
41
+ queue_as :default
42
+
43
+ # Important! Otherwise, we can get caught in an infinite loop.
44
+ rescue_from(ActiveJob::DeserializationError) { |e| Rails.logger.error e }
45
+
46
+ def perform(event)
47
+ Raven.send_event(event)
48
+ end
49
+ end
50
+
51
+ .. describe:: encoding
52
+
53
+ While unlikely that you'll need to change it, by default Raven compresses outgoing messages with gzip. This has a slight impact on performance, but due to the size of many Ruby stacktrace it's required for the serve to accept the content.
54
+
55
+ To disable gzip, set the encoding to 'json':
56
+
57
+ .. code-block:: ruby
58
+
59
+ config.encoding = 'json'
60
+
61
+ .. describe:: environments
62
+
63
+ As of v0.10.0, 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.
64
+
65
+ Alternately, you can configure Raven to run only in certain environments by configuring the environments whitelist. For example, to only run Sentry in production:
66
+
67
+ .. code-block:: ruby
68
+
69
+ config.environments = %w[ production ]
70
+
71
+ Sentry automatically sets the current environment to RAILS_ENV, or if it is not present, RACK_ENV. If you are using Sentry outside of Rack or Rails, or wish to override environment detection, you'll need to set the current environment yourself:
72
+
73
+ .. code-block:: ruby
74
+
75
+ config.current_environment = 'my_cool_environment'
76
+
77
+ .. describe:: excluded_exceptions
78
+
79
+ If you never wish to be notified of certain exceptions, specify 'excluded_exceptions' in your config file.
80
+
81
+ In the example below, the exceptions Rails uses to generate 404 responses will be suppressed.
82
+
83
+ .. code-block:: ruby
84
+
85
+ config.excluded_exceptions = ['ActionController::RoutingError', 'ActiveRecord::RecordNotFound']
86
+
87
+ You can find the list of exceptions that are excluded by default in ``Raven::Configuration::IGNORE_DEFAULT``. Remember you'll be overriding those defaults by setting this configuration.
88
+
89
+ .. describe:: logger
90
+
91
+ The name of the logger used by Sentry. Default is an instance of Raven::Logger.
92
+
93
+ .. code-block:: ruby
94
+
95
+ config.logger = Raven::Logger.new(STDOUT)
96
+
97
+ Raven respects logger levels.
98
+
99
+ .. describe:: processors
100
+
101
+ If you need to sanitize or pre-process (before its sent to the server) data, you can do so using the Processors implementation. By default, a few processors are installed. The most important is ``Raven::Processor::SanitizeData``, which will attempt to sanitize keys that match various patterns (e.g. password) and values that resemble credit card numbers.
102
+
103
+ In your Sentry UI, data which has been sanitized will appear as "********" (or 0, if the value was an Integer).
104
+
105
+ To specify your own (or to remove the defaults), simply pass them with your configuration:
106
+
107
+ .. code-block:: ruby
108
+
109
+ config.processors = [MyOwnProcessor]
110
+
111
+ Check out ``Raven::Processor::SanitizeData`` to see how a Processor is implemented.
112
+
113
+ You can also specify values to be sanitized. Any strings matched will be replaced with the string mask (********). One good use for this is to copy Rails' filter_parameters:
114
+
115
+ .. code-block:: ruby
116
+
117
+ config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
118
+
119
+ The client scrubs the HTTP "Authorization" header of requests before sending them to Sentry, to prevent sensitive credentials from being sent. You can specify additional HTTP headers to ignore:
120
+
121
+ .. code-block:: ruby
122
+
123
+ config.sanitize_http_headers = ["Via", "Referer", "User-Agent", "Server", "From"]
124
+
125
+ For more information about HTTP headers which may contain sensitive information in your application, see `RFC 2616 <https://www.w3.org/Protocols/rfc2616/rfc2616-sec15.html>`_.
126
+
127
+ By default, Sentry sends up a stacktrace with an exception. This stacktrace may contain data which you may consider to be sensitive, including lines of source code, line numbers, module names, and source paths. To wipe the stacktrace from all error reports, require and add the RemoveStacktrace processor:
128
+
129
+ .. code-block:: ruby
130
+
131
+ require 'raven/processor/removestacktrace'
132
+
133
+ Raven.configure do |config|
134
+ config.processors << Raven::Processor::RemoveStacktrace
135
+ end
136
+
137
+ By default, Sentry does not send POST data or cookies if present. To re-enable, remove the respective processor from the chain:
138
+
139
+ .. code-block:: ruby
140
+
141
+ Raven.configure do |config|
142
+ config.processors -= [Raven::Processor::PostData] # Do this to send POST data
143
+ config.processors -= [Raven::Processor::Cookies] # Do this to send cookies by default
144
+ end
145
+
146
+ .. describe:: proxy
147
+
148
+ A string with the URL of the HTTP proxy to be used.
149
+
150
+ .. code-block:: ruby
151
+
152
+ config.proxy = 'http://path.to.my.proxy.com'
153
+
154
+ .. describe:: rails_report_rescued_exceptions
155
+
156
+ Rails catches exceptions in the ActionDispatch::ShowExceptions or ActionDispatch::DebugExceptions middlewares, depending on the environment. When `rails_report_rescued_exceptions` is true (it is by default), Raven will report exceptions even when they are rescued by these middlewares.
157
+
158
+ If you are using a custom exceptions app, you may wish to disable this behavior:
159
+
160
+ .. code-block:: ruby
161
+
162
+ config.rails_report_rescued_exceptions = false
163
+
164
+ .. describe:: release
165
+
166
+ Track the version of your application in Sentry.
167
+
168
+ We guess the release intelligently in the following order of preference:
169
+
170
+ * Commit SHA of the last commit (git)
171
+ * Reading from the REVISION file in the app root
172
+ * Heroku's dyno metadata (must have enabled via Heroku Labs)
173
+
174
+ .. code-block:: ruby
175
+
176
+ config.release = '721e41770371db95eee98ca2707686226b993eda'
177
+
178
+ .. describe:: should_capture
179
+
180
+ By providing a proc or lambda, you can control what events are captured. Events are passed to the Proc or lambda you provide - returning false will stop the event from sending to Sentry:
181
+
182
+ .. code-block:: ruby
183
+
184
+ config.should_capture = Proc.new { |e| true unless e.contains_sensitive_info? }
185
+
186
+ .. describe:: silence_ready
187
+
188
+ Upon start, Raven will write the following message to the log at the INFO level:
189
+
190
+ ``
191
+ ** [out :: hostname.example.com] I, [2014-07-22T15:32:57.498368 #30897] INFO -- : ** [Raven] Raven 0.9.4 ready to catch errors"
192
+ ``
193
+
194
+ You can turn off this message:
195
+
196
+ .. code-block:: ruby
197
+
198
+ config.silence_ready = true
199
+
200
+ .. describe:: ssl_verification
201
+
202
+ By default SSL certificate verification is enabled in the client. It can be disabled.
203
+
204
+ .. code-block:: ruby
205
+
206
+ config.ssl_verification = false
207
+
208
+ .. describe:: tags
209
+
210
+ Default tags to send with each event.
211
+
212
+ .. code-block:: ruby
213
+
214
+ config.tags = { foo: :bar }
215
+
216
+ .. describe:: transport_failure_callback
217
+
218
+ If the transport fails to send an event to Sentry for any reason (either the Sentry server has returned a 4XX or 5XX response), this Proc or lambda will be called.
219
+
220
+ .. code-block:: ruby
221
+
222
+ config.transport_failure_callback = lambda { |event|
223
+ AdminMailer.email_admins("Oh god, it's on fire!").deliver_later
224
+ }
225
+
226
+ Environment Variables
227
+ ---------------------
228
+
229
+ .. describe:: SENTRY_DSN
230
+
231
+ 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.
232
+
233
+ With Raven, you may either set the SENTRY_DSN environment variable (recommended), or set your DSN manually in a config block:
234
+
235
+ .. code-block:: ruby
236
+
237
+ # in Rails, this might be in config/initializers/sentry.rb
238
+ Raven.configure do |config|
239
+ config.dsn = 'http://public:secret@example.com/project-id'
240
+ end