sentry-raven 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/raven/configuration.rb +4 -0
- data/lib/raven/event.rb +1 -1
- data/lib/raven/integrations/rails.rb +4 -1
- data/lib/raven/integrations/sidekiq.rb +14 -5
- data/lib/raven/transports/http.rb +1 -0
- data/lib/raven/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb65022aed8ddc08bcb526c2c71d0b53b6cda940
|
4
|
+
data.tar.gz: '079e7ee3652a38722ebf913095cfd45be86d79d7'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aafa4ea87fc78346f7050cddfc71f445e6a9deccc5990c1cebfaf8b62882178a8160d40bf9267ec014c826ffa8a1a2bc8b3cea13a6f748ccca6b2c4feda3e5b
|
7
|
+
data.tar.gz: 00000f1fe367791b055f763e3100223bc3f71827a41d60c2dcfcbe63baf4ec25214e3c3a21383901c56e5d4c4c0d72b6be07b1534cf0ecc6b5c5fe1eb0f3bb13
|
data/lib/raven/configuration.rb
CHANGED
@@ -37,6 +37,10 @@ module Raven
|
|
37
37
|
# The Faraday adapter to be used. Will default to Net::HTTP when not set.
|
38
38
|
attr_accessor :http_adapter
|
39
39
|
|
40
|
+
# A Proc yeilding the faraday builder allowing for further configuration
|
41
|
+
# of the faraday adapter
|
42
|
+
attr_accessor :faraday_builder
|
43
|
+
|
40
44
|
# You may provide your own LineCache for matching paths with source files.
|
41
45
|
# This may be useful if you need to get source code from places other than
|
42
46
|
# the disk. See Raven::LineCache for the required interface you must implement.
|
data/lib/raven/event.rb
CHANGED
@@ -21,7 +21,7 @@ module Raven
|
|
21
21
|
BACKTRACE_RE = /^(.+?):(\d+)(?::in `(.+?)')?$/
|
22
22
|
|
23
23
|
PLATFORM = "ruby".freeze
|
24
|
-
SDK = { "name" => "
|
24
|
+
SDK = { "name" => "raven-ruby", "version" => Raven::VERSION }.freeze
|
25
25
|
|
26
26
|
attr_accessor :id, :timestamp, :time_spent, :level, :logger,
|
27
27
|
:culprit, :server_name, :release, :modules, :extra, :tags,
|
@@ -32,10 +32,13 @@ module Raven
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
config.before_initialize do
|
36
|
+
Raven.configuration.logger = ::Rails.logger
|
37
|
+
end
|
38
|
+
|
35
39
|
config.after_initialize do
|
36
40
|
Raven.configure do |config|
|
37
41
|
config.project_root ||= ::Rails.root
|
38
|
-
config.logger ||= ::Rails.logger
|
39
42
|
config.release ||= config.detect_release # if project_root has changed, need to re-check
|
40
43
|
end
|
41
44
|
|
@@ -2,7 +2,16 @@ require 'time'
|
|
2
2
|
require 'sidekiq'
|
3
3
|
|
4
4
|
module Raven
|
5
|
-
class
|
5
|
+
class SidekiqCleanupMiddleware
|
6
|
+
def call(_worker, _job, _queue)
|
7
|
+
yield
|
8
|
+
ensure
|
9
|
+
Context.clear!
|
10
|
+
BreadcrumbBuffer.clear!
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class SidekiqErrorHandler
|
6
15
|
ACTIVEJOB_RESERVED_PREFIX = "_aj_".freeze
|
7
16
|
|
8
17
|
def call(ex, context)
|
@@ -13,9 +22,6 @@ module Raven
|
|
13
22
|
:extra => { :sidekiq => context },
|
14
23
|
:culprit => culprit_from_context(context)
|
15
24
|
)
|
16
|
-
ensure
|
17
|
-
Context.clear!
|
18
|
-
BreadcrumbBuffer.clear!
|
19
25
|
end
|
20
26
|
|
21
27
|
private
|
@@ -59,6 +65,9 @@ end
|
|
59
65
|
|
60
66
|
if Sidekiq::VERSION > '3'
|
61
67
|
Sidekiq.configure_server do |config|
|
62
|
-
config.error_handlers << Raven::
|
68
|
+
config.error_handlers << Raven::SidekiqErrorHandler.new
|
69
|
+
config.server_middleware do |chain|
|
70
|
+
chain.add Raven::SidekiqCleanupMiddleware
|
71
|
+
end
|
63
72
|
end
|
64
73
|
end
|
data/lib/raven/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-raven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|