honeybadger 5.14.2 → 5.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/honeybadger/agent.rb +12 -1
- data/lib/honeybadger/config/defaults.rb +13 -2
- data/lib/honeybadger/config.rb +24 -3
- data/lib/honeybadger/event.rb +1 -1
- data/lib/honeybadger/notification_subscriber.rb +0 -1
- data/lib/honeybadger/plugins/solid_queue.rb +1 -1
- data/lib/honeybadger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60300a5d8ccaecda5eeff8887f76c5c54dba5c4610539c4ff8865d1355a5c124
|
4
|
+
data.tar.gz: d057c93fc1a8d24f6fdb4a952d5b56cf8dbf0f3ee07466eaad38d3be2efcad13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06cdba44a37870e7b2e51414efb9ac48f5e3dc8015403a7b40e3a12520f0d037ab77f90205ea85f610de2d9bee11b6b6d5bf63fcbfce6a8d296ef8d1aeec7af9
|
7
|
+
data.tar.gz: 6538734d781bd200445e9ac603baf2fbd3b91a0e723112cb79d7468a56baaadc38921fdd75dfd4bde8ad25a67e911e3c56020dcff54f49414066abd68c83dc9a
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
3
|
|
4
|
+
## [5.15.0](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.14.2...v5.15.0) (2024-07-18)
|
5
|
+
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* define default events to ignore, allow for override ([#570](https://github.com/honeybadger-io/honeybadger-ruby/issues/570)) ([a6f2177](https://github.com/honeybadger-io/honeybadger-ruby/commit/a6f2177eb69b75eafef235768187ccf6b3a538f0))
|
10
|
+
|
4
11
|
## [5.14.2](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.14.1...v5.14.2) (2024-07-17)
|
5
12
|
|
6
13
|
|
data/lib/honeybadger/agent.rb
CHANGED
@@ -404,7 +404,18 @@ module Honeybadger
|
|
404
404
|
with_error_handling { hook.call(event) }
|
405
405
|
end
|
406
406
|
|
407
|
-
return if config.ignored_events.any?
|
407
|
+
return if config.ignored_events.any? do |check|
|
408
|
+
with_error_handling do
|
409
|
+
check.all? do |keys, value|
|
410
|
+
if keys == [:event_type]
|
411
|
+
event.event_type&.match?(value)
|
412
|
+
elsif event.dig(*keys)
|
413
|
+
event.dig(*keys).to_s.match?(value)
|
414
|
+
end
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
408
419
|
return if event.halted?
|
409
420
|
|
410
421
|
events_worker.push(event.as_json)
|
@@ -31,6 +31,12 @@ module Honeybadger
|
|
31
31
|
'Sinatra::NotFound',
|
32
32
|
'Sidekiq::JobRetry::Skip'].map(&:freeze).freeze
|
33
33
|
|
34
|
+
IGNORE_EVENTS_DEFAULT = [
|
35
|
+
{ event_type: 'sql.active_record', query: /^(begin|commit)( transaction)?$/i },
|
36
|
+
{ event_type: 'sql.active_record', query: /(solid_queue|good_job)/i },
|
37
|
+
{ event_type: 'process_action.action_controller', controller: 'Rails::HealthController' }
|
38
|
+
].freeze
|
39
|
+
|
34
40
|
DEVELOPMENT_ENVIRONMENTS = ['development', 'test', 'cucumber'].map(&:freeze).freeze
|
35
41
|
|
36
42
|
DEFAULT_PATHS = ['honeybadger.yml', 'config/honeybadger.yml', "#{ENV['HOME']}/honeybadger.yml"].map(&:freeze).freeze
|
@@ -112,8 +118,13 @@ module Honeybadger
|
|
112
118
|
type: Boolean
|
113
119
|
},
|
114
120
|
:'events.ignore' => {
|
115
|
-
description: 'A list of events to ignore. Use a
|
116
|
-
default:
|
121
|
+
description: 'A list of additional events to ignore. Use a hash to query nested payloads, match using a string or regex. Non-hash will match on the event_type.',
|
122
|
+
default: IGNORE_EVENTS_DEFAULT,
|
123
|
+
type: Array
|
124
|
+
},
|
125
|
+
:'events.ignore_only' => {
|
126
|
+
description: 'A list of events to ignore (overrides the default ignored events).',
|
127
|
+
default: nil,
|
117
128
|
type: Array
|
118
129
|
},
|
119
130
|
plugins: {
|
data/lib/honeybadger/config.rb
CHANGED
@@ -192,10 +192,22 @@ module Honeybadger
|
|
192
192
|
DEFAULTS[:'exceptions.ignore'] | Array(ignore)
|
193
193
|
end
|
194
194
|
|
195
|
+
def raw_ignored_events
|
196
|
+
ignore_only = get(:'events.ignore_only')
|
197
|
+
return ignore_only if ignore_only
|
198
|
+
return DEFAULTS[:'events.ignore'] unless ignore = get(:'events.ignore')
|
199
|
+
|
200
|
+
DEFAULTS[:'events.ignore'] | Array(ignore)
|
201
|
+
end
|
202
|
+
|
195
203
|
def ignored_events
|
196
|
-
|
197
|
-
check.is_a?(String)
|
198
|
-
|
204
|
+
@ignored_events ||= raw_ignored_events.map do |check|
|
205
|
+
if check.is_a?(String) || check.is_a?(Regexp)
|
206
|
+
{ [:event_type] => check }
|
207
|
+
elsif check.is_a?(Hash)
|
208
|
+
flat_hash(check).transform_keys! { |key_array| key_array.map(&:to_sym) }
|
209
|
+
end
|
210
|
+
end.compact
|
199
211
|
end
|
200
212
|
|
201
213
|
def ca_bundle_path
|
@@ -455,5 +467,14 @@ module Honeybadger
|
|
455
467
|
end
|
456
468
|
end
|
457
469
|
end
|
470
|
+
|
471
|
+
# Converts a nested hash into a single layer where keys become arrays:
|
472
|
+
# ex: > flat_hash({ :nested => { :hash => "value" }})
|
473
|
+
# > { [:nested, :hash] => "value" }
|
474
|
+
def flat_hash(h,f=[],g={})
|
475
|
+
return g.update({ f=>h }) unless h.is_a? Hash
|
476
|
+
h.each { |k,r| flat_hash(r,f+[k],g) }
|
477
|
+
g
|
478
|
+
end
|
458
479
|
end
|
459
480
|
end
|
data/lib/honeybadger/event.rb
CHANGED
@@ -2,7 +2,7 @@ module Honeybadger
|
|
2
2
|
module Plugins
|
3
3
|
module SolidQueue
|
4
4
|
Plugin.register :solid_queue do
|
5
|
-
requirement { defined?(::SolidQueue) }
|
5
|
+
requirement { config.load_plugin_insights?(:solid_queue) && defined?(::SolidQueue) }
|
6
6
|
|
7
7
|
collect do
|
8
8
|
if config.cluster_collection?(:solid_queue)
|
data/lib/honeybadger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeybadger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Honeybadger Industries LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make managing application errors a more pleasant experience.
|
14
14
|
email:
|