kuende-opbeat 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +36 -0
  5. data/Gemfile +2 -0
  6. data/LICENSE +205 -0
  7. data/Makefile +3 -0
  8. data/README.md +267 -0
  9. data/Rakefile +19 -0
  10. data/gemfiles/rails30.gemfile +9 -0
  11. data/gemfiles/rails31.gemfile +9 -0
  12. data/gemfiles/rails32.gemfile +9 -0
  13. data/gemfiles/rails40.gemfile +9 -0
  14. data/gemfiles/rails41.gemfile +9 -0
  15. data/gemfiles/rails42.gemfile +9 -0
  16. data/gemfiles/ruby192_rails31.gemfile +10 -0
  17. data/gemfiles/ruby192_rails32.gemfile +10 -0
  18. data/gemfiles/sidekiq31.gemfile +11 -0
  19. data/lib/opbeat.rb +132 -0
  20. data/lib/opbeat/better_attr_accessor.rb +44 -0
  21. data/lib/opbeat/capistrano.rb +9 -0
  22. data/lib/opbeat/capistrano/capistrano2.rb +47 -0
  23. data/lib/opbeat/capistrano/capistrano3.rb +26 -0
  24. data/lib/opbeat/client.rb +122 -0
  25. data/lib/opbeat/configuration.rb +90 -0
  26. data/lib/opbeat/error.rb +6 -0
  27. data/lib/opbeat/event.rb +223 -0
  28. data/lib/opbeat/filter.rb +63 -0
  29. data/lib/opbeat/integrations/delayed_job.rb +32 -0
  30. data/lib/opbeat/integrations/resque.rb +22 -0
  31. data/lib/opbeat/integrations/sidekiq.rb +32 -0
  32. data/lib/opbeat/interfaces.rb +35 -0
  33. data/lib/opbeat/interfaces/exception.rb +16 -0
  34. data/lib/opbeat/interfaces/http.rb +57 -0
  35. data/lib/opbeat/interfaces/message.rb +19 -0
  36. data/lib/opbeat/interfaces/stack_trace.rb +50 -0
  37. data/lib/opbeat/linecache.rb +25 -0
  38. data/lib/opbeat/logger.rb +21 -0
  39. data/lib/opbeat/rack.rb +44 -0
  40. data/lib/opbeat/rails/middleware/debug_exceptions_catcher.rb +22 -0
  41. data/lib/opbeat/railtie.rb +26 -0
  42. data/lib/opbeat/tasks.rb +24 -0
  43. data/lib/opbeat/version.rb +3 -0
  44. data/opbeat.gemspec +28 -0
  45. data/spec/opbeat/better_attr_accessor_spec.rb +99 -0
  46. data/spec/opbeat/client_spec.rb +35 -0
  47. data/spec/opbeat/configuration_spec.rb +50 -0
  48. data/spec/opbeat/event_spec.rb +138 -0
  49. data/spec/opbeat/filter_spec.rb +101 -0
  50. data/spec/opbeat/integrations/delayed_job_spec.rb +38 -0
  51. data/spec/opbeat/logger_spec.rb +55 -0
  52. data/spec/opbeat/opbeat_spec.rb +89 -0
  53. data/spec/opbeat/rack_spec.rb +116 -0
  54. data/spec/spec_helper.rb +22 -0
  55. metadata +218 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e724cf01215b3110a5e9d6f1f058289d7f9db202
4
+ data.tar.gz: 05af61c23ed3f5ec4717d00fe0bf527b6fbc328f
5
+ SHA512:
6
+ metadata.gz: a6f83cbfc8e74c49af868374114ab6fc2541170bed29bb4f16d4f61557232cdded1af0bb858b645df217268f9702912b86fd9039461d6d73bc89cbc8e9ce90ec
7
+ data.tar.gz: bad6186e5b923835e24377a30f301147a6daf7033c6bf40b10b46628eb096ab5f9c6a7510fa588ae03560b49b271578419eab532a7ef74a60886c2245c0c4996
@@ -0,0 +1,5 @@
1
+ coverage
2
+ pkg
3
+ ruby/
4
+ .bundle
5
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --colour
2
+ --format documentation
@@ -0,0 +1,36 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - 2.0
6
+ - 2.1
7
+ - 2.2
8
+ - jruby
9
+ - rbx-2
10
+ gemfile:
11
+ - gemfiles/rails30.gemfile
12
+ - gemfiles/rails31.gemfile
13
+ - gemfiles/rails32.gemfile
14
+ - gemfiles/rails40.gemfile
15
+ - gemfiles/rails41.gemfile
16
+ - gemfiles/rails42.gemfile
17
+ matrix:
18
+ include:
19
+ - rvm: 1.9.2
20
+ gemfile: gemfiles/ruby192_rails31.gemfile
21
+ - rvm: 1.9.2
22
+ gemfile: gemfiles/ruby192_rails32.gemfile
23
+ exclude:
24
+ - rvm: 1.9.2
25
+ gemfile: gemfiles/rails31.gemfile
26
+ - rvm: 1.9.2
27
+ gemfile: gemfiles/rails32.gemfile
28
+ - rvm: 1.9.2
29
+ gemfile: gemfiles/rails40.gemfile
30
+ - rvm: 1.9.2
31
+ gemfile: gemfiles/rails41.gemfile
32
+ - rvm: 1.9.2
33
+ gemfile: gemfiles/rails42.gemfile
34
+ notifications:
35
+ slack:
36
+ secure: IniiL3PdFsht2zykTwd/z5Et/L1U6GzsmMC1LrgccKCrvLsdcdlBU3VrAgIb1GT9FPEFpb5sl7FEBN80p6uW15uO57onUawFaSWDhSA3eXG1ImmunVPJ20U4NkJvMbnUdZXQ9XXqOw1ggkR7GrD0PM9Nzr4puWaaGq42UJjdaq0=
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org/"
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,205 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2015 Opbeat, Inc
190
+
191
+ Large portions:
192
+ Copyright 2012 Functional Software, Inc
193
+
194
+
195
+ Licensed under the Apache License, Version 2.0 (the "License");
196
+ you may not use this file except in compliance with the License.
197
+ You may obtain a copy of the License at
198
+
199
+ http://www.apache.org/licenses/LICENSE-2.0
200
+
201
+ Unless required by applicable law or agreed to in writing, software
202
+ distributed under the License is distributed on an "AS IS" BASIS,
203
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
204
+ See the License for the specific language governing permissions and
205
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ test:
2
+ bundle install
3
+ rake spec
@@ -0,0 +1,267 @@
1
+ # Opbeat
2
+
3
+ [![Build Status](https://travis-ci.org/opbeat/opbeat_ruby.svg?branch=master)](https://travis-ci.org/opbeat/opbeat_ruby)
4
+
5
+ A client and integration layer for [Opbeat](https://opbeat.com). Forked from the [raven-ruby](https://github.com/getsentry/raven-ruby) project.
6
+
7
+ ## Installation
8
+
9
+ Add the following to your `Gemfile`:
10
+
11
+ ```ruby
12
+ gem "opbeat", "~> 2.0"
13
+ ```
14
+
15
+ The Opbeat gem adhere to [Semantic
16
+ Versioning](http://guides.rubygems.org/patterns/#semantic-versioning)
17
+ and so you can safely trust all minor and patch versions (e.g. 2.x.x) to
18
+ be backwards compatible.
19
+
20
+ ## Usage
21
+
22
+ ### Rails 3 and Rails 4
23
+
24
+ Add a `config/initializers/opbeat.rb` containing:
25
+
26
+ ```ruby
27
+ require 'opbeat'
28
+
29
+ Opbeat.configure do |config|
30
+ config.organization_id = '094e250818f44e82bfae13919f55fb35'
31
+ config.app_id = '094e250818'
32
+ config.secret_token = 'f0f5237a221637f561a15614f5fef218f8d6317d'
33
+ end
34
+ ```
35
+
36
+ ### Rails 2
37
+
38
+ No support for Rails 2 yet.
39
+
40
+ ### Rack
41
+
42
+ Basic RackUp file.
43
+
44
+ ```ruby
45
+ require 'opbeat'
46
+
47
+ use Opbeat::Rack
48
+
49
+ Opbeat.configure do |config|
50
+ config.organization_id = '094e250818f44e82bfae13919f55fb35'
51
+ config.app_id = '094e250818'
52
+ config.secret_token = 'f0f5237a221637f561a15614f5fef218f8d6317d'
53
+ end
54
+
55
+ ```
56
+
57
+ ### Sinatra
58
+
59
+ ```ruby
60
+ require 'sinatra'
61
+ require 'opbeat'
62
+
63
+ use Opbeat::Rack
64
+
65
+ Opbeat.configure do |config|
66
+ config.organization_id = '094e250818f44e82bfae13919f55fb35'
67
+ config.app_id = '094e250818'
68
+ config.secret_token = 'f0f5237a221637f561a15614f5fef218f8d6317d'
69
+ end
70
+
71
+ get '/' do
72
+ 1 / 0
73
+ end
74
+ ```
75
+
76
+ ### Other Ruby
77
+
78
+ ```ruby
79
+ require 'opbeat'
80
+
81
+ Opbeat.configure do |config|
82
+ config.organization_id = '094e250818f44e82bfae13919f55fb35'
83
+ config.app_id = '094e250818'
84
+ config.secret_token = 'f0f5237a221637f561a15614f5fef218f8d6317d'
85
+
86
+ # manually configure environment if ENV['RACK_ENV'] is not defined
87
+ config.current_environment = 'production'
88
+ end
89
+
90
+ Opbeat.capture # Global style
91
+
92
+ Opbeat.capture do # Block style
93
+ 1 / 0
94
+ end
95
+ ```
96
+
97
+ ## Background processing
98
+
99
+ With [delayed_job](https://github.com/collectiveidea/delayed_job) and [sidekiq](http://sidekiq.org/), Opbeat will automatically pick up exceptions that are raised in background jobs.
100
+
101
+ To enable Opbeat for [resque](https://github.com/resque/resque), add the following (for example in `config/initializers/opbeat.rb`):
102
+
103
+ ```ruby
104
+ require "resque/failure/multiple"
105
+ require "opbeat/integrations/resque"
106
+
107
+ Resque::Failure::Multiple.classes = [Resque::Failure::Opbeat]
108
+ Resque::Failure.backend = Resque::Failure::Multiple
109
+ ```
110
+
111
+ ## Explicitly notifying Opbeat
112
+
113
+ It is possible to explicitely notify Opbeat. In the case of a simple message:
114
+ ```
115
+ Opbeat.capture_message("Not happy with the way things turned out")
116
+ ```
117
+
118
+ If you want to catch and explicitely send an exception to Opbeat, this is the way to do it:
119
+ ```
120
+ begin
121
+ faultyCall
122
+ rescue Exception => e
123
+ Opbeat.capture_exception(e)
124
+ ```
125
+
126
+ Both `Opbeat.capture_exception` and `Opbeat.capture_message` take additional `options`:
127
+ ```ruby
128
+ Opbeat.capture_message("Device registration error", :extra => {:device_id => my_device_id})
129
+ ```
130
+
131
+
132
+ ## Notifications in development mode
133
+
134
+ By default events will be sent to Opbeat if your application is running in any of the following environments: `development`, `production`, `default`. Environment is set by default if you are running a Rack application (i.e. anytime `ENV['RACK_ENV']` is set).
135
+
136
+ You can configure Opbeat to run only in production environments by configuring the `environments` whitelist:
137
+
138
+ ```ruby
139
+ require 'opbeat'
140
+
141
+ Opbeat.configure do |config|
142
+ config.organization_id = '094e250818f44e82bfae13919f55fb35'
143
+ config.app_id = '094e250818'
144
+ config.secret_token = 'f0f5237a221637f561a15614f5fef218f8d6317d'
145
+
146
+ config.environments = %w[ production ]
147
+ end
148
+ ```
149
+
150
+ ## Excluding Exceptions
151
+
152
+ If you never wish to be notified of certain exceptions, specify 'excluded_exceptions' in your config file.
153
+
154
+ In the example below, the exceptions Rails uses to generate 404 responses will be suppressed.
155
+
156
+ ```ruby
157
+ require 'opbeat'
158
+
159
+ Opbeat.configure do |config|
160
+ config.organization_id = '094e250818f44e82bfae13919f55fb35'
161
+ config.app_id = '094e250818'
162
+ config.secret_token = 'f0f5237a221637f561a15614f5fef218f8d6317d'
163
+
164
+ config.excluded_exceptions = ['ActionController::RoutingError', 'ActiveRecord::RecordNotFound']
165
+ end
166
+ ```
167
+
168
+ ## Sanitizing Data
169
+
170
+ The Opbeat agent will sanitize the data sent to the Opbeat server based
171
+ on the following rules.
172
+
173
+ If you are running Rails, the agent will first try to fetch the
174
+ filtering settings from `Rails.application.config.filter_parameters`.
175
+
176
+ If those are not set (or if you are not running Rails), the agent will
177
+ fall back to its own defaults:
178
+
179
+ ```ruby
180
+ /(authorization|password|passwd|secret)/i
181
+ ```
182
+
183
+ To specify your own (or to remove the defaults), simply set the
184
+ `filter_parameters` configuration parameter:
185
+
186
+ ```ruby
187
+ require 'opbeat'
188
+
189
+ Opbeat.configure do |config|
190
+ config.organization_id = '094e250818f44e82bfae13919f55fb35'
191
+ config.app_id = '094e250818'
192
+ config.secret_token = 'f0f5237a221637f561a15614f5fef218f8d6317d'
193
+
194
+ config.filter_parameters = [:credit_card, /^pass(word)$/i]
195
+ end
196
+ ```
197
+
198
+ Note that only the `data`, `query_string` and `cookies` fields under
199
+ `http` are filtered.
200
+
201
+ ## User information
202
+
203
+ With Rails, Opbeat expects `controller#current_user` to return an object with `id`, `email` and/or `username` attributes. You can change the name of the current user method in the following manner:
204
+
205
+ ```ruby
206
+ Opbeat.configure do |config|
207
+ ...
208
+ config.user_controller_method = "my_other_user_method"
209
+ end
210
+ ```
211
+
212
+ Opbeat will now call `controller#my_other_user_method` to retrieve the user object.
213
+
214
+ ## Setting context
215
+
216
+ It is possible to set a context which be included an exceptions that are captured.
217
+
218
+ ```ruby
219
+ Opbeat.set_context :extra => {:device_id => my_device_id}
220
+
221
+ Opbeat.capture_message("Hello world") # will include the context
222
+ ```
223
+
224
+ ## Timeouts
225
+
226
+ Opbeat uses a low default timeout. If you frequently experience timeouts, try increasing it in the following manner:
227
+
228
+ ```ruby
229
+ Opbeat.configure do |config|
230
+ ...
231
+ config.timeout = 5
232
+ config.open_timeout = 5
233
+ end
234
+ ```
235
+
236
+ ## Async Delivery
237
+
238
+ When an error occurs, the notification is immediately sent to Opbeat.
239
+ This will hold up the client HTTP request as long as the request to
240
+ Opbeat is ongoing. Alternatively the agent can be configured to send
241
+ notifications asynchronously.
242
+
243
+ Example using a native Ruby `Thread`:
244
+
245
+ ```ruby
246
+ Opbeat.configure do |config|
247
+ config.async = lambda { |event|
248
+ Thread.new { Opbeat.send(event) }
249
+ }
250
+ end
251
+ ```
252
+
253
+ Using this decoupled approach you can easily implement this into your
254
+ existing background job infrastructure. The only requirement is that you
255
+ at some point call the `Opbeat.send` method with the `event` object.
256
+
257
+ ## Testing
258
+
259
+ ```bash
260
+ $ bundle install
261
+ $ rake spec
262
+ ```
263
+
264
+ ## Resources
265
+
266
+ * [Bug Tracker](http://github.com/opbeat/opbeat_ruby/issues)
267
+ * [Code](http://github.com/opbeat/opbeat_ruby)