sentry-raven 2.6.3 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +0 -1
- data/.rubocop.yml +1 -1
- data/.travis.yml +6 -5
- data/README.md +0 -3
- data/changelog.md +22 -0
- data/docs/breadcrumbs.rst +11 -0
- data/docs/config.rst +17 -5
- data/docs/context.rst +23 -0
- data/docs/index.rst +1 -0
- data/docs/integrations/puma.rst +1 -1
- data/docs/processors.rst +124 -0
- data/lib/raven/backtrace.rb +2 -1
- data/lib/raven/base.rb +6 -0
- data/lib/raven/cli.rb +1 -1
- data/lib/raven/client.rb +0 -3
- data/lib/raven/configuration.rb +60 -4
- data/lib/raven/context.rb +2 -1
- data/lib/raven/event.rb +136 -211
- data/lib/raven/integrations/rack.rb +1 -0
- data/lib/raven/integrations/rails.rb +2 -0
- data/lib/raven/integrations/rails/controller_transaction.rb +13 -0
- data/lib/raven/integrations/rake.rb +6 -1
- data/lib/raven/integrations/sidekiq.rb +11 -7
- data/lib/raven/interfaces/exception.rb +0 -2
- data/lib/raven/interfaces/http.rb +0 -2
- data/lib/raven/interfaces/single_exception.rb +0 -2
- data/lib/raven/interfaces/stack_trace.rb +3 -14
- data/lib/raven/processor/sanitizedata.rb +2 -2
- data/lib/raven/processor/utf8conversion.rb +1 -0
- data/lib/raven/transports.rb +0 -2
- data/lib/raven/transports/http.rb +0 -1
- data/lib/raven/utils/deep_merge.rb +6 -14
- data/lib/raven/version.rb +1 -1
- metadata +5 -4
- data/lib/raven/error.rb +0 -4
@@ -0,0 +1,13 @@
|
|
1
|
+
module Raven
|
2
|
+
class Rails
|
3
|
+
module ControllerTransaction
|
4
|
+
def self.included(base)
|
5
|
+
base.around_action do |controller, block|
|
6
|
+
Raven.context.transaction.push "#{controller.class}##{controller.action_name}"
|
7
|
+
block.call
|
8
|
+
Raven.context.transaction.pop
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -6,7 +6,12 @@ module Rake
|
|
6
6
|
class Application
|
7
7
|
alias orig_display_error_messsage display_error_message
|
8
8
|
def display_error_message(ex)
|
9
|
-
Raven.capture_exception
|
9
|
+
Raven.capture_exception(
|
10
|
+
ex,
|
11
|
+
:transaction => top_level_tasks.join(' '),
|
12
|
+
:logger => 'rake',
|
13
|
+
:tags => { 'rake_task' => top_level_tasks.join(' ') }
|
14
|
+
)
|
10
15
|
orig_display_error_messsage(ex)
|
11
16
|
end
|
12
17
|
end
|
@@ -3,7 +3,9 @@ require 'sidekiq'
|
|
3
3
|
|
4
4
|
module Raven
|
5
5
|
class SidekiqCleanupMiddleware
|
6
|
-
def call(_worker,
|
6
|
+
def call(_worker, job, queue)
|
7
|
+
Raven.context.transaction.push "Sidekiq/#{job['class']}"
|
8
|
+
Raven.extra_context(:sidekiq => job.merge("queue" => queue))
|
7
9
|
yield
|
8
10
|
Context.clear!
|
9
11
|
BreadcrumbBuffer.clear!
|
@@ -15,11 +17,11 @@ module Raven
|
|
15
17
|
|
16
18
|
def call(ex, context)
|
17
19
|
context = filter_context(context)
|
20
|
+
Raven.context.transaction.push transaction_from_context(context)
|
18
21
|
Raven.capture_exception(
|
19
22
|
ex,
|
20
23
|
:message => ex.message,
|
21
|
-
:extra => { :sidekiq => context }
|
22
|
-
:culprit => culprit_from_context(context)
|
24
|
+
:extra => { :sidekiq => context }
|
23
25
|
)
|
24
26
|
Context.clear!
|
25
27
|
BreadcrumbBuffer.clear!
|
@@ -51,12 +53,14 @@ module Raven
|
|
51
53
|
|
52
54
|
# this will change in the future:
|
53
55
|
# https://github.com/mperham/sidekiq/pull/3161
|
54
|
-
def
|
55
|
-
classname = (context["
|
56
|
+
def transaction_from_context(context)
|
57
|
+
classname = (context["wrapped"] || context["class"] ||
|
58
|
+
(context[:job] && (context[:job]["wrapped"] || context[:job]["class"]))
|
59
|
+
)
|
56
60
|
if classname
|
57
61
|
"Sidekiq/#{classname}"
|
58
|
-
elsif context[
|
59
|
-
"Sidekiq/#{context[
|
62
|
+
elsif context[:event]
|
63
|
+
"Sidekiq/#{context[:event]}"
|
60
64
|
else
|
61
65
|
"Sidekiq"
|
62
66
|
end
|
@@ -1,11 +1,8 @@
|
|
1
|
-
require 'raven/interface'
|
2
|
-
|
3
1
|
module Raven
|
4
2
|
class StacktraceInterface < Interface
|
5
3
|
attr_accessor :frames
|
6
4
|
|
7
5
|
def initialize(*arguments)
|
8
|
-
self.frames = []
|
9
6
|
super(*arguments)
|
10
7
|
end
|
11
8
|
|
@@ -21,24 +18,16 @@ module Raven
|
|
21
18
|
|
22
19
|
# Not actually an interface, but I want to use the same style
|
23
20
|
class Frame < Interface
|
24
|
-
attr_accessor :abs_path
|
25
|
-
|
26
|
-
attr_accessor :vars
|
27
|
-
attr_accessor :pre_context
|
28
|
-
attr_accessor :post_context
|
29
|
-
attr_accessor :context_line
|
30
|
-
attr_accessor :module
|
31
|
-
attr_accessor :lineno
|
32
|
-
attr_accessor :in_app
|
21
|
+
attr_accessor :abs_path, :context_line, :function, :in_app,
|
22
|
+
:lineno, :module, :pre_context, :post_context, :vars
|
33
23
|
|
34
24
|
def initialize(*arguments)
|
35
|
-
self.vars, self.pre_context, self.post_context = [], [], []
|
36
25
|
super(*arguments)
|
37
26
|
end
|
38
27
|
|
39
28
|
def filename
|
40
29
|
return if abs_path.nil?
|
41
|
-
return @filename if
|
30
|
+
return @filename if instance_variable_defined?(:@filename)
|
42
31
|
|
43
32
|
prefix =
|
44
33
|
if under_project_root? && in_app
|
@@ -4,7 +4,7 @@ require 'json'
|
|
4
4
|
module Raven
|
5
5
|
class Processor::SanitizeData < Processor
|
6
6
|
DEFAULT_FIELDS = %w(authorization password passwd secret ssn social(.*)?sec).freeze
|
7
|
-
CREDIT_CARD_RE =
|
7
|
+
CREDIT_CARD_RE = /\b(?:3[47]\d|(?:4\d|5[1-5]|65)\d{2}|6011)\d{12}\b/
|
8
8
|
QUERY_STRING = ['query_string', :query_string].freeze
|
9
9
|
JSON_STARTS_WITH = ["[", "{"].freeze
|
10
10
|
|
@@ -62,7 +62,7 @@ module Raven
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def fields_re
|
65
|
-
return @fields_re if
|
65
|
+
return @fields_re if instance_variable_defined?(:@fields_re)
|
66
66
|
fields = DEFAULT_FIELDS | sanitize_fields
|
67
67
|
fields -= sanitize_fields_excluded
|
68
68
|
@fields_re = /#{fields.map do |f|
|
@@ -23,6 +23,7 @@ module Raven
|
|
23
23
|
# so instead we check if it only contains actual ASCII codepoints, and if
|
24
24
|
# not we assume it's actually just UTF8 and scrub accordingly.
|
25
25
|
if value.encoding == Encoding::BINARY && !value.ascii_only?
|
26
|
+
value = value.dup
|
26
27
|
value.force_encoding(Encoding::UTF_8)
|
27
28
|
end
|
28
29
|
return value if value.valid_encoding?
|
data/lib/raven/transports.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# rubocop:disable all
|
2
1
|
module Raven
|
3
2
|
module Utils
|
4
3
|
# ported from ActiveSupport
|
@@ -8,23 +7,16 @@ module Raven
|
|
8
7
|
end
|
9
8
|
|
10
9
|
def self.deep_merge!(hash, other_hash, &block)
|
11
|
-
other_hash
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
hash.merge!(other_hash) do |key, this_val, other_val|
|
11
|
+
if this_val.is_a?(Hash) && other_val.is_a?(Hash)
|
12
|
+
deep_merge(this_val, other_val, &block)
|
13
|
+
elsif block_given?
|
14
|
+
block.call(key, this_val, other_val)
|
16
15
|
else
|
17
|
-
|
18
|
-
block.call(current_key, this_value, other_value)
|
19
|
-
else
|
20
|
-
other_value
|
21
|
-
end
|
16
|
+
other_val
|
22
17
|
end
|
23
18
|
end
|
24
|
-
|
25
|
-
hash
|
26
19
|
end
|
27
20
|
end
|
28
21
|
end
|
29
22
|
end
|
30
|
-
# rubocop:enable all
|
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.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- docs/integrations/rack.rst
|
63
63
|
- docs/integrations/rails.rst
|
64
64
|
- docs/make.bat
|
65
|
+
- docs/processors.rst
|
65
66
|
- docs/sentry-doc-config.json
|
66
67
|
- docs/usage.rst
|
67
68
|
- exe/raven
|
@@ -75,7 +76,6 @@ files:
|
|
75
76
|
- lib/raven/client.rb
|
76
77
|
- lib/raven/configuration.rb
|
77
78
|
- lib/raven/context.rb
|
78
|
-
- lib/raven/error.rb
|
79
79
|
- lib/raven/event.rb
|
80
80
|
- lib/raven/instance.rb
|
81
81
|
- lib/raven/integrations/delayed_job.rb
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- lib/raven/integrations/rails.rb
|
85
85
|
- lib/raven/integrations/rails/active_job.rb
|
86
86
|
- lib/raven/integrations/rails/controller_methods.rb
|
87
|
+
- lib/raven/integrations/rails/controller_transaction.rb
|
87
88
|
- lib/raven/integrations/rails/overrides/debug_exceptions_catcher.rb
|
88
89
|
- lib/raven/integrations/rails/overrides/streaming_reporter.rb
|
89
90
|
- lib/raven/integrations/railties.rb
|
@@ -135,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
136
|
version: '0'
|
136
137
|
requirements: []
|
137
138
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.6.
|
139
|
+
rubygems_version: 2.6.13
|
139
140
|
signing_key:
|
140
141
|
specification_version: 4
|
141
142
|
summary: A gem that provides a client interface for the Sentry error logger
|
data/lib/raven/error.rb
DELETED