bugsnag 6.21.0 → 6.24.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +102 -0
- data/VERSION +1 -1
- data/lib/bugsnag/breadcrumb_type.rb +14 -0
- data/lib/bugsnag/breadcrumbs/breadcrumb.rb +34 -1
- data/lib/bugsnag/breadcrumbs/breadcrumbs.rb +1 -0
- data/lib/bugsnag/breadcrumbs/on_breadcrumb_callback_list.rb +50 -0
- data/lib/bugsnag/cleaner.rb +31 -18
- data/lib/bugsnag/configuration.rb +240 -22
- data/lib/bugsnag/delivery/synchronous.rb +2 -2
- data/lib/bugsnag/delivery/thread_queue.rb +2 -2
- data/lib/bugsnag/endpoint_configuration.rb +11 -0
- data/lib/bugsnag/endpoint_validator.rb +80 -0
- data/lib/bugsnag/error.rb +25 -0
- data/lib/bugsnag/event.rb +7 -0
- data/lib/bugsnag/integrations/rack.rb +3 -3
- data/lib/bugsnag/integrations/rails/active_job.rb +102 -0
- data/lib/bugsnag/integrations/railtie.rb +9 -1
- data/lib/bugsnag/integrations/resque.rb +17 -3
- data/lib/bugsnag/middleware/active_job.rb +18 -0
- data/lib/bugsnag/middleware/delayed_job.rb +21 -2
- data/lib/bugsnag/middleware/exception_meta_data.rb +2 -0
- data/lib/bugsnag/middleware/rack_request.rb +84 -19
- data/lib/bugsnag/middleware/rails3_request.rb +2 -2
- data/lib/bugsnag/middleware/rake.rb +1 -1
- data/lib/bugsnag/middleware/session_data.rb +3 -1
- data/lib/bugsnag/middleware/sidekiq.rb +1 -1
- data/lib/bugsnag/report.rb +166 -6
- data/lib/bugsnag/session_tracker.rb +52 -12
- data/lib/bugsnag/stacktrace.rb +10 -1
- data/lib/bugsnag/tasks/bugsnag.rake +1 -1
- data/lib/bugsnag/utility/duplicator.rb +124 -0
- data/lib/bugsnag/utility/metadata_delegate.rb +102 -0
- data/lib/bugsnag.rb +126 -4
- metadata +16 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f9bcfd0b8a1fa0f25ff5bb465319cb96f254f3cef1f7aaac847ecd7f624062b
|
4
|
+
data.tar.gz: 3eb77e9bd754fe86d185dc062b9b41d9c224d0b8901991d75f95f80c22b266f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5f463a241c45255229297447cbc047526db02c04b6cf0ea03905f46a0ba6ada617d0de2d9aeadaa17da5e944f0ddcbe6418c564071331230c50e825b801bea6
|
7
|
+
data.tar.gz: c27128f59737759e67c028a3984f41f6792746d27c42c7ee4c8820f3d0eda1bbef580c0dde4dbaf1ad63d4433eeeadb6c462344c58c2bcaf4deb5d5f218e54e5
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,108 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
## v6.24.1 (30 November 2021)
|
5
|
+
|
6
|
+
### Fixes
|
7
|
+
|
8
|
+
* Fix metadata not being recorded when using Resque outside of Active Job
|
9
|
+
| [#710](https://github.com/bugsnag/bugsnag-ruby/pull/710)
|
10
|
+
| [isnotajoke](https://github.com/isnotajoke)
|
11
|
+
|
12
|
+
## v6.24.0 (6 October 2021)
|
13
|
+
|
14
|
+
### Enhancements
|
15
|
+
|
16
|
+
* Allow overriding an event's unhandled flag
|
17
|
+
| [#698](https://github.com/bugsnag/bugsnag-ruby/pull/698)
|
18
|
+
* Add the ability to store metadata globally
|
19
|
+
| [#699](https://github.com/bugsnag/bugsnag-ruby/pull/699)
|
20
|
+
* Add `cookies`, `body` and `httpVersion` to the automatically captured request data for Rack apps
|
21
|
+
| [#700](https://github.com/bugsnag/bugsnag-ruby/pull/700)
|
22
|
+
* Add `Configuration#endpoints` for reading the notify and sessions endpoints and `Configuration#endpoints=` for setting them
|
23
|
+
| [#701](https://github.com/bugsnag/bugsnag-ruby/pull/701)
|
24
|
+
* Add `Configuration#redacted_keys`. This is like `meta_data_filters` but matches strings with case-insensitive equality, rather than matching based on inclusion
|
25
|
+
| [#703](https://github.com/bugsnag/bugsnag-ruby/pull/703)
|
26
|
+
* Allow pausing and resuming sessions, giving more control over the stability score
|
27
|
+
| [#704](https://github.com/bugsnag/bugsnag-ruby/pull/704)
|
28
|
+
* Add `Configuration#vendor_paths` to replace `Configuration#vendor_path`
|
29
|
+
| [#705](https://github.com/bugsnag/bugsnag-ruby/pull/705)
|
30
|
+
|
31
|
+
### Deprecated
|
32
|
+
|
33
|
+
* In the next major release, `params` will only contain query string parameters. Currently it also contains the request body for form data requests, but this is deprecated in favour of the new `body` property
|
34
|
+
* The `Configuration#set_endpoints` method is now deprecated in favour of `Configuration#endpoints=`
|
35
|
+
* The `Configuration#meta_data_filters` option is now deprecated in favour of `Configuration#redacted_keys`
|
36
|
+
* The `Configuration#vendor_path` option is now deprecated in favour of `Configuration#vendor_paths`
|
37
|
+
|
38
|
+
## v6.23.0 (21 September 2021)
|
39
|
+
|
40
|
+
### Enhancements
|
41
|
+
|
42
|
+
* Sessions will now be delivered every 10 seconds, instead of every 30 seconds
|
43
|
+
| [#680](https://github.com/bugsnag/bugsnag-ruby/pull/680)
|
44
|
+
* Log errors that prevent delivery at `ERROR` level
|
45
|
+
| [#681](https://github.com/bugsnag/bugsnag-ruby/pull/681)
|
46
|
+
* Add `on_breadcrumb` callbacks to replace `before_breadcrumb_callbacks`
|
47
|
+
| [#686](https://github.com/bugsnag/bugsnag-ruby/pull/686)
|
48
|
+
* Add `context` attribute to configuration, which will be used as the default context for events. Using this option will disable automatic context setting
|
49
|
+
| [#687](https://github.com/bugsnag/bugsnag-ruby/pull/687)
|
50
|
+
| [#688](https://github.com/bugsnag/bugsnag-ruby/pull/688)
|
51
|
+
* Add `Bugsnag#breadcrumbs` getter to fetch the current list of breadcrumbs
|
52
|
+
| [#689](https://github.com/bugsnag/bugsnag-ruby/pull/689)
|
53
|
+
* Add `time` (an ISO8601 string in UTC) to `device` metadata
|
54
|
+
| [#690](https://github.com/bugsnag/bugsnag-ruby/pull/690)
|
55
|
+
* Add `errors` to `Report`/`Event` containing an array of `Error` objects. The `Error` object contains `error_class`, `error_message`, `stacktrace` and `type` (always "ruby")
|
56
|
+
| [#691](https://github.com/bugsnag/bugsnag-ruby/pull/691)
|
57
|
+
* Add `original_error` to `Report`/`Event` containing the original Exception instance
|
58
|
+
| [#692](https://github.com/bugsnag/bugsnag-ruby/pull/692)
|
59
|
+
* Add `request` to `Report`/`Event` containing HTTP request metadata
|
60
|
+
| [#693](https://github.com/bugsnag/bugsnag-ruby/pull/693)
|
61
|
+
* Add `add_metadata` and `clear_metadata` to `Report`/`Event`
|
62
|
+
| [#694](https://github.com/bugsnag/bugsnag-ruby/pull/694)
|
63
|
+
* Add `set_user` to `Report`/`Event`
|
64
|
+
| [#695](https://github.com/bugsnag/bugsnag-ruby/pull/695)
|
65
|
+
|
66
|
+
### Fixes
|
67
|
+
|
68
|
+
* Avoid starting session delivery thread when the current release stage is not enabled
|
69
|
+
| [#677](https://github.com/bugsnag/bugsnag-ruby/pull/677)
|
70
|
+
|
71
|
+
### Deprecated
|
72
|
+
|
73
|
+
* `before_breadcrumb_callbacks` have been deprecated in favour of `on_breadcrumb` callbacks and will be removed in the next major release
|
74
|
+
* For consistency with Bugsnag notifiers for other languages, a number of methods have been deprecated in this release. The old options will be removed in the next major version | [#676](https://github.com/bugsnag/bugsnag-ruby/pull/676)
|
75
|
+
* The `notify_release_stages` configuration option has been deprecated in favour of `enabled_release_stages`
|
76
|
+
* The `auto_capture_sessions` and `track_sessions` configuration options have been deprecated in favour of `auto_track_sessions`
|
77
|
+
* The `enabled_automatic_breadcrumb_types` configuration option has been deprecated in favour of `enabled_breadcrumb_types`
|
78
|
+
* The `Report` class has been deprecated in favour of the `Event` class
|
79
|
+
* The `Report#meta_data` attribute has been deprecated in favour of `Event#metadata`
|
80
|
+
* The `Breadcrumb#meta_data` attribute has been deprecated in favour of `Breadcrumb#metadata`
|
81
|
+
* The `Breadcrumb#name` attribute has been deprecated in favour of `Breadcrumb#message`
|
82
|
+
* The breadcrumb type constants in the `Bugsnag::Breadcrumbs` module has been deprecated in favour of the constants available in the `Bugsnag::BreadcrumbType` module
|
83
|
+
For example, `Bugsnag::Breadcrumbs::ERROR_BREADCRUMB_TYPE` is now available as `Bugsnag::BreadcrumbType::ERROR`
|
84
|
+
* `Report#exceptions` has been deprecated in favour of the new `errors` property
|
85
|
+
* `Report#raw_exceptions` has been deprecated in favour of the new `original_error` property
|
86
|
+
* Accessing request data via `Report#metadata` has been deprecated in favour of using the new `request` property. Request data will be moved out of metadata in the next major version
|
87
|
+
* The `Report#add_tab` and `Report#remove_tab` methods have been deprecated in favour of the new `add_metadata` and `clear_metadata` methods
|
88
|
+
|
89
|
+
## v6.22.1 (11 August 2021)
|
90
|
+
|
91
|
+
### Fixes
|
92
|
+
|
93
|
+
* Fix possible `LocalJumpError` introduced in v6.22.0
|
94
|
+
| [#675](https://github.com/bugsnag/bugsnag-ruby/pull/675)
|
95
|
+
|
96
|
+
## v6.22.0 (10 August 2021)
|
97
|
+
|
98
|
+
### Enhancements
|
99
|
+
|
100
|
+
* Add support for tracking exceptions and capturing metadata in Active Job, when not using an existing integration
|
101
|
+
| [#670](https://github.com/bugsnag/bugsnag-ruby/pull/670)
|
102
|
+
|
103
|
+
* Improve the report context when using Delayed Job or Resque as the Active Job queue adapter
|
104
|
+
| [#671](https://github.com/bugsnag/bugsnag-ruby/pull/671)
|
105
|
+
|
4
106
|
## v6.21.0 (23 June 2021)
|
5
107
|
|
6
108
|
### Enhancements
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.24.1
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "bugsnag/breadcrumbs/breadcrumbs"
|
2
|
+
|
3
|
+
module Bugsnag
|
4
|
+
module BreadcrumbType
|
5
|
+
ERROR = Bugsnag::Breadcrumbs::ERROR_BREADCRUMB_TYPE
|
6
|
+
LOG = Bugsnag::Breadcrumbs::LOG_BREADCRUMB_TYPE
|
7
|
+
MANUAL = Bugsnag::Breadcrumbs::MANUAL_BREADCRUMB_TYPE
|
8
|
+
NAVIGATION = Bugsnag::Breadcrumbs::NAVIGATION_BREADCRUMB_TYPE
|
9
|
+
PROCESS = Bugsnag::Breadcrumbs::PROCESS_BREADCRUMB_TYPE
|
10
|
+
REQUEST = Bugsnag::Breadcrumbs::REQUEST_BREADCRUMB_TYPE
|
11
|
+
STATE = Bugsnag::Breadcrumbs::STATE_BREADCRUMB_TYPE
|
12
|
+
USER = Bugsnag::Breadcrumbs::USER_BREADCRUMB_TYPE
|
13
|
+
end
|
14
|
+
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
module Bugsnag::Breadcrumbs
|
2
2
|
class Breadcrumb
|
3
|
+
# @deprecated Use {#message} instead
|
3
4
|
# @return [String] the breadcrumb name
|
4
5
|
attr_accessor :name
|
5
6
|
|
6
7
|
# @return [String] the breadcrumb type
|
7
8
|
attr_accessor :type
|
8
9
|
|
10
|
+
# @deprecated Use {#metadata} instead
|
9
11
|
# @return [Hash, nil] metadata hash containing strings, numbers, or booleans, or nil
|
10
12
|
attr_accessor :meta_data
|
11
13
|
|
@@ -23,7 +25,7 @@ module Bugsnag::Breadcrumbs
|
|
23
25
|
# @api private
|
24
26
|
#
|
25
27
|
# @param name [String] the breadcrumb name
|
26
|
-
# @param type [String] the breadcrumb type from Bugsnag::
|
28
|
+
# @param type [String] the breadcrumb type from Bugsnag::BreadcrumbType
|
27
29
|
# @param meta_data [Hash, nil] a hash containing strings, numbers, or booleans, or nil
|
28
30
|
# @param auto [Symbol] set to `:auto` if the breadcrumb is automatically generated
|
29
31
|
def initialize(name, type, meta_data, auto)
|
@@ -72,5 +74,36 @@ module Bugsnag::Breadcrumbs
|
|
72
74
|
:timestamp => @timestamp.iso8601(3)
|
73
75
|
}
|
74
76
|
end
|
77
|
+
|
78
|
+
# TODO: "message" and "metadata" can be simple attr_accessors when they
|
79
|
+
# replace "name" and "meta_data"
|
80
|
+
# NOTE: these are not aliases as YARD doesn't allow documenting the non-alias
|
81
|
+
# as deprecated without also marking the alias as deprecated
|
82
|
+
|
83
|
+
# The breadcrumb message
|
84
|
+
# @!attribute message
|
85
|
+
# @return [String]
|
86
|
+
def message
|
87
|
+
@name
|
88
|
+
end
|
89
|
+
|
90
|
+
# @param message [String]
|
91
|
+
# @return [void]
|
92
|
+
def message=(message)
|
93
|
+
@name = message
|
94
|
+
end
|
95
|
+
|
96
|
+
# A Hash containing arbitrary metadata associated with this breadcrumb
|
97
|
+
# @!attribute metadata
|
98
|
+
# @return [Hash, nil]
|
99
|
+
def metadata
|
100
|
+
@meta_data
|
101
|
+
end
|
102
|
+
|
103
|
+
# @param metadata [Hash, nil]
|
104
|
+
# @return [void]
|
105
|
+
def metadata=(metadata)
|
106
|
+
@meta_data = metadata
|
107
|
+
end
|
75
108
|
end
|
76
109
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require "set"
|
2
|
+
|
3
|
+
module Bugsnag::Breadcrumbs
|
4
|
+
class OnBreadcrumbCallbackList
|
5
|
+
def initialize(configuration)
|
6
|
+
@callbacks = Set.new
|
7
|
+
@mutex = Mutex.new
|
8
|
+
@configuration = configuration
|
9
|
+
end
|
10
|
+
|
11
|
+
##
|
12
|
+
# @param callback [Proc, Method, #call]
|
13
|
+
# @return [void]
|
14
|
+
def add(callback)
|
15
|
+
@mutex.synchronize do
|
16
|
+
@callbacks.add(callback)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
##
|
21
|
+
# @param callback [Proc, Method, #call]
|
22
|
+
# @return [void]
|
23
|
+
def remove(callback)
|
24
|
+
@mutex.synchronize do
|
25
|
+
@callbacks.delete(callback)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
##
|
30
|
+
# @param breadcrumb [Breadcrumb]
|
31
|
+
# @return [void]
|
32
|
+
def call(breadcrumb)
|
33
|
+
@callbacks.each do |callback|
|
34
|
+
begin
|
35
|
+
should_continue = callback.call(breadcrumb)
|
36
|
+
rescue StandardError => e
|
37
|
+
@configuration.warn("Error occurred in on_breadcrumb callback: '#{e}'")
|
38
|
+
@configuration.warn("on_breadcrumb callback stacktrace: #{e.backtrace.inspect}")
|
39
|
+
end
|
40
|
+
|
41
|
+
# only stop if should_continue is explicity 'false' to allow callbacks
|
42
|
+
# to return 'nil'
|
43
|
+
if should_continue == false
|
44
|
+
breadcrumb.ignore!
|
45
|
+
break
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/lib/bugsnag/cleaner.rb
CHANGED
@@ -25,7 +25,7 @@ module Bugsnag
|
|
25
25
|
# @param url [String]
|
26
26
|
# @return [String]
|
27
27
|
def clean_url(url)
|
28
|
-
return url if @configuration.meta_data_filters.empty?
|
28
|
+
return url if @configuration.meta_data_filters.empty? && @configuration.redacted_keys.empty?
|
29
29
|
|
30
30
|
uri = URI(url)
|
31
31
|
return url unless uri.query
|
@@ -43,6 +43,33 @@ module Bugsnag
|
|
43
43
|
uri.to_s
|
44
44
|
end
|
45
45
|
|
46
|
+
##
|
47
|
+
# @param key [String, #to_s]
|
48
|
+
# @return [Boolean]
|
49
|
+
def filters_match?(key)
|
50
|
+
str = key.to_s
|
51
|
+
|
52
|
+
matched = @configuration.meta_data_filters.any? do |filter|
|
53
|
+
case filter
|
54
|
+
when Regexp
|
55
|
+
str.match(filter)
|
56
|
+
else
|
57
|
+
str.include?(filter.to_s)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
return true if matched
|
62
|
+
|
63
|
+
@configuration.redacted_keys.any? do |redaction_pattern|
|
64
|
+
case redaction_pattern
|
65
|
+
when Regexp
|
66
|
+
str.match(redaction_pattern)
|
67
|
+
when String
|
68
|
+
str.downcase == redaction_pattern.downcase
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
46
73
|
private
|
47
74
|
|
48
75
|
##
|
@@ -54,9 +81,11 @@ module Bugsnag
|
|
54
81
|
#
|
55
82
|
# @return [Boolean]
|
56
83
|
def deep_filters?
|
57
|
-
|
84
|
+
is_deep_filter = proc do |filter|
|
58
85
|
filter.is_a?(Regexp) && filter.to_s.include?("\\.".freeze)
|
59
86
|
end
|
87
|
+
|
88
|
+
@configuration.meta_data_filters.any?(&is_deep_filter) || @configuration.redacted_keys.any?(&is_deep_filter)
|
60
89
|
end
|
61
90
|
|
62
91
|
def clean_string(str)
|
@@ -137,22 +166,6 @@ module Bugsnag
|
|
137
166
|
value
|
138
167
|
end
|
139
168
|
|
140
|
-
##
|
141
|
-
# @param key [String, #to_s]
|
142
|
-
# @return [Boolean]
|
143
|
-
def filters_match?(key)
|
144
|
-
str = key.to_s
|
145
|
-
|
146
|
-
@configuration.meta_data_filters.any? do |filter|
|
147
|
-
case filter
|
148
|
-
when Regexp
|
149
|
-
str.match(filter)
|
150
|
-
else
|
151
|
-
str.include?(filter.to_s)
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
169
|
##
|
157
170
|
# If someone has a Rails filter like /^stuff\.secret/, it won't match
|
158
171
|
# "request.params.stuff.secret", so we try it both with and without the
|