opbeat 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -90,6 +90,20 @@ Opbeat.capture do # Block style
90
90
  end
91
91
  ```
92
92
 
93
+ ## Background processing
94
+
95
+ 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.
96
+
97
+ To enable Opbeat for [resque](https://github.com/resque/resque), add the following (for example in `config/initializers/opbeat.rb`):
98
+
99
+ ```ruby
100
+ require "resque/failure/multiple"
101
+ require "opbeat/integrations/resque"
102
+
103
+ Resque::Failure::Multiple.classes = [Resque::Failure::Opbeat]
104
+ Resque::Failure.backend = Resque::Failure::Multiple
105
+ ```
106
+
93
107
  ## Testing
94
108
 
95
109
  ```bash
@@ -97,6 +111,21 @@ $ bundle install
97
111
  $ rake spec
98
112
  ```
99
113
 
114
+ ## Explicitly notifying Opbeat
115
+
116
+ It is possible to explicitely notify Opbeat. In the case of a simple message:
117
+ ```
118
+ Opbeat.captureMessage("Not happy with the way things turned out")
119
+ ```
120
+
121
+ If you want to catch and explicitely send an exception to Opbeat, this is the way to do it:
122
+ ```
123
+ begin
124
+ faultyCall
125
+ rescue Exception => e
126
+ Opbeat.captureException(e)
127
+ ```
128
+
100
129
  ## Notifications in development mode
101
130
 
102
131
  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).
@@ -5,7 +5,9 @@ module Opbeat
5
5
  def self.load_into(configuration)
6
6
 
7
7
  configuration.load do
8
- after "deploy", "opbeat:notify"
8
+ after "deploy", "opbeat:notify"
9
+ after "deploy:migrations", "opbeat:notify"
10
+ after "deploy:cold", "opbeat:notify"
9
11
  namespace :opbeat do
10
12
  desc "Notifies Opbeat of new deployments"
11
13
  task :notify, :except => { :no_release => true } do
@@ -0,0 +1,22 @@
1
+ begin
2
+ require 'resque'
3
+ rescue LoadError
4
+ end
5
+
6
+ if defined?(Resque)
7
+
8
+ module Resque
9
+ module Failure
10
+ # Failure backend for Opbeat
11
+ class Opbeat < Base
12
+ # @override (see Resque::Failure::Base#save)
13
+ # @param (see Resque::Failure::Base#save)
14
+ # @return (see Resque::Failure::Base#save)
15
+ def save
16
+ ::Opbeat.captureException(exception)
17
+ end
18
+ end
19
+ end
20
+ end
21
+
22
+ end
@@ -1,3 +1,3 @@
1
1
  module Opbeat
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opbeat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2014-07-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
17
- requirement: &11336760 !ruby/object:Gem::Requirement
17
+ requirement: &16930920 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -25,10 +25,10 @@ dependencies:
25
25
  version: '0.10'
26
26
  type: :runtime
27
27
  prerelease: false
28
- version_requirements: *11336760
28
+ version_requirements: *16930920
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: uuidtools
31
- requirement: &11364420 !ruby/object:Gem::Requirement
31
+ requirement: &16929160 !ruby/object:Gem::Requirement
32
32
  none: false
33
33
  requirements:
34
34
  - - ~>
@@ -36,10 +36,10 @@ dependencies:
36
36
  version: 2.1.4
37
37
  type: :runtime
38
38
  prerelease: false
39
- version_requirements: *11364420
39
+ version_requirements: *16929160
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: multi_json
42
- requirement: &11362460 !ruby/object:Gem::Requirement
42
+ requirement: &16928640 !ruby/object:Gem::Requirement
43
43
  none: false
44
44
  requirements:
45
45
  - - ~>
@@ -47,10 +47,10 @@ dependencies:
47
47
  version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
- version_requirements: *11362460
50
+ version_requirements: *16928640
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: hashie
53
- requirement: &11358040 !ruby/object:Gem::Requirement
53
+ requirement: &16927620 !ruby/object:Gem::Requirement
54
54
  none: false
55
55
  requirements:
56
56
  - - ~>
@@ -58,7 +58,7 @@ dependencies:
58
58
  version: 2.1.1
59
59
  type: :runtime
60
60
  prerelease: false
61
- version_requirements: *11358040
61
+ version_requirements: *16927620
62
62
  description:
63
63
  email: ron@opbeat.com
64
64
  executables: []
@@ -75,6 +75,7 @@ files:
75
75
  - lib/opbeat/error.rb
76
76
  - lib/opbeat/event.rb
77
77
  - lib/opbeat/integrations/delayed_job.rb
78
+ - lib/opbeat/integrations/resque.rb
78
79
  - lib/opbeat/integrations/sidekiq.rb
79
80
  - lib/opbeat/interfaces/exception.rb
80
81
  - lib/opbeat/interfaces/http.rb