honeybadger 5.29.1 → 5.30.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/CHANGELOG.md +19 -0
- data/lib/honeybadger/agent.rb +1 -0
- data/lib/honeybadger/config/defaults.rb +17 -1
- data/lib/honeybadger/events_worker.rb +15 -10
- data/lib/honeybadger/notification_subscriber.rb +19 -5
- data/lib/honeybadger/plugins/delayed_job.rb +1 -1
- data/lib/honeybadger/plugins/faktory.rb +1 -1
- data/lib/honeybadger/plugins/flipper.rb +33 -0
- data/lib/honeybadger/plugins/resque.rb +1 -1
- data/lib/honeybadger/plugins/shoryuken.rb +1 -1
- data/lib/honeybadger/plugins/sucker_punch.rb +1 -1
- data/lib/honeybadger/plugins/thor.rb +1 -1
- data/lib/honeybadger/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed40cc30de2e8d36fddf858556a318eec3f5c2287ff275057316ccf249cd8272
|
|
4
|
+
data.tar.gz: d122da5b9b7c9ecd631d7c2826a98836a6bda3e72c29d693b9b7176ed4c6e1c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 416605ad4d17558d8e3c6f5f8b5ad47e15cecdadd1124723037ed72699e6da69a11a784f476e44bff71e511fb6dedcfd2d3747fa55c098b30600360602c6fff4
|
|
7
|
+
data.tar.gz: f2f633e433f28ec237ad6aca137de38491484015a4a0e85e07ab6d34fd67bc67a0f68e18c3d04313eb5301472dad8c032a6a5e7740b35ad5d6ee519a7eaf6a95
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## [5.30.0](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.29.1...v5.30.0) (2026-04-28)
|
|
5
|
+
|
|
6
|
+
Backport of Insights improvements from master ([#808](https://github.com/honeybadger-io/honeybadger-ruby/pull/808)).
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
* send Flipper events to Insights
|
|
10
|
+
* attach environment to Insights event payloads
|
|
11
|
+
* add cached attribute to ActiveRecordSubscriber
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
* allow jobs in Active Job subscriber payloads
|
|
15
|
+
* prevent thread leak in EventsWorker#kill!
|
|
16
|
+
* reduce Insights logging
|
|
17
|
+
* log fewer 429 responses in events worker
|
|
18
|
+
* replace `return` with `next` in execution blocks to prevent LocalJumpError
|
|
19
|
+
|
|
20
|
+
### Performance
|
|
21
|
+
* ignore cache_* ActiveSupport events by default
|
|
22
|
+
|
|
4
23
|
## [5.29.1](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.29.0...v5.29.1) (2025-07-01)
|
|
5
24
|
|
|
6
25
|
|
data/lib/honeybadger/agent.rb
CHANGED
|
@@ -413,6 +413,7 @@ module Honeybadger
|
|
|
413
413
|
extra_payload = {}.tap do |p|
|
|
414
414
|
p[:request_id] = context_manager.get_request_id if context_manager.get_request_id
|
|
415
415
|
p[:hostname] = config[:hostname].to_s if config[:'events.attach_hostname']
|
|
416
|
+
p[:environment] = config[:env].to_s if config[:'events.attach_environment'] && config[:env].to_s.length > 0
|
|
416
417
|
p.update(context_manager.get_event_context || {})
|
|
417
418
|
end
|
|
418
419
|
|
|
@@ -36,7 +36,13 @@ module Honeybadger
|
|
|
36
36
|
{ event_type: 'sql.active_record', query: /^(begin|commit)( immediate)?( transaction)?$/i },
|
|
37
37
|
{ event_type: 'sql.active_record', query: /(solid_queue|good_job)/i },
|
|
38
38
|
{ event_type: 'sql.active_record', name: /^GoodJob/ },
|
|
39
|
-
{ event_type: 'process_action.action_controller', controller: 'Rails::HealthController' }
|
|
39
|
+
{ event_type: 'process_action.action_controller', controller: 'Rails::HealthController' },
|
|
40
|
+
{ event_type: 'cache_exist?.active_support' },
|
|
41
|
+
{ event_type: 'cache_write.active_support' },
|
|
42
|
+
{ event_type: 'cache_generate.active_support' },
|
|
43
|
+
{ event_type: 'cache_delete.active_support' },
|
|
44
|
+
{ event_type: 'cache_increment.active_support' },
|
|
45
|
+
{ event_type: 'cache_decrement.active_support' }
|
|
40
46
|
].freeze
|
|
41
47
|
|
|
42
48
|
DEVELOPMENT_ENVIRONMENTS = ['development', 'test', 'cucumber'].map(&:freeze).freeze
|
|
@@ -119,6 +125,11 @@ module Honeybadger
|
|
|
119
125
|
default: true,
|
|
120
126
|
type: Boolean
|
|
121
127
|
},
|
|
128
|
+
:'events.attach_environment' => {
|
|
129
|
+
description: 'Add the environment to all event payloads.',
|
|
130
|
+
default: true,
|
|
131
|
+
type: Boolean
|
|
132
|
+
},
|
|
122
133
|
:'events.ignore' => {
|
|
123
134
|
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.',
|
|
124
135
|
default: IGNORE_EVENTS_DEFAULT,
|
|
@@ -521,6 +532,11 @@ module Honeybadger
|
|
|
521
532
|
description: 'Enable automatic metric data aggregation for Autotuner stats.',
|
|
522
533
|
default: false,
|
|
523
534
|
type: Boolean
|
|
535
|
+
},
|
|
536
|
+
:'flipper.insights.enabled' => {
|
|
537
|
+
description: 'Enable automatic data collection for Flipper.',
|
|
538
|
+
default: true,
|
|
539
|
+
type: Boolean
|
|
524
540
|
}
|
|
525
541
|
}.freeze
|
|
526
542
|
|
|
@@ -137,9 +137,13 @@ module Honeybadger
|
|
|
137
137
|
def kill!
|
|
138
138
|
d { 'killing worker thread' }
|
|
139
139
|
|
|
140
|
+
if timeout_thread
|
|
141
|
+
Thread.kill(timeout_thread)
|
|
142
|
+
timeout_thread.join # Allow ensure blocks to execute.
|
|
143
|
+
end
|
|
144
|
+
|
|
140
145
|
if thread
|
|
141
146
|
Thread.kill(thread)
|
|
142
|
-
Thread.kill(timeout_thread)
|
|
143
147
|
thread.join # Allow ensure blocks to execute.
|
|
144
148
|
end
|
|
145
149
|
|
|
@@ -286,27 +290,28 @@ module Honeybadger
|
|
|
286
290
|
case response.code
|
|
287
291
|
when 429, 503
|
|
288
292
|
throttle = inc_throttle
|
|
289
|
-
|
|
293
|
+
debug { sprintf('Insights Event send failed: project is sending too many events. code=%s throttle=%s interval=%s', response.code, throttle, throttle_interval) }
|
|
294
|
+
suspend(3600)
|
|
290
295
|
when 402
|
|
291
|
-
warn { sprintf('Event send failed: payment is required. code=%s', response.code) }
|
|
296
|
+
warn { sprintf('Insights Event send failed: payment is required. code=%s', response.code) }
|
|
292
297
|
suspend(3600)
|
|
293
298
|
when 403
|
|
294
|
-
warn { sprintf('Event send failed: API key is invalid. code=%s', response.code) }
|
|
299
|
+
warn { sprintf('Insights Event send failed: API key is invalid. code=%s', response.code) }
|
|
295
300
|
suspend(3600)
|
|
296
301
|
when 413
|
|
297
|
-
warn { sprintf('Event send failed: Payload is too large. code=%s', response.code) }
|
|
302
|
+
warn { sprintf('Insights Event send failed: Payload is too large. code=%s', response.code) }
|
|
298
303
|
when 201
|
|
299
304
|
if throttle = dec_throttle
|
|
300
|
-
debug { sprintf('Success ⚡ Event sent code=%s throttle=%s interval=%s', response.code, throttle, throttle_interval) }
|
|
305
|
+
debug { sprintf('Success ⚡ Insights Event sent code=%s throttle=%s interval=%s', response.code, throttle, throttle_interval) }
|
|
301
306
|
else
|
|
302
|
-
debug { sprintf('Success ⚡ Event sent code=%s', response.code) }
|
|
307
|
+
debug { sprintf('Success ⚡ Insights Event sent code=%s', response.code) }
|
|
303
308
|
end
|
|
304
309
|
when :stubbed
|
|
305
|
-
info {
|
|
310
|
+
info { 'Success ⚡ Development mode is enabled; This event will be sent after app is deployed.' }
|
|
306
311
|
when :error
|
|
307
|
-
warn { sprintf('Event send failed: an unknown error occurred. code=%s error=%s', response.code, response.message.to_s.dump) }
|
|
312
|
+
warn { sprintf('Insights Event send failed: an unknown error occurred. code=%s error=%s', response.code, response.message.to_s.dump) }
|
|
308
313
|
else
|
|
309
|
-
warn { sprintf('Event send failed: unknown response from server. code=%s', response.code) }
|
|
314
|
+
warn { sprintf('Insights Event send failed: unknown response from server. code=%s', response.code) }
|
|
310
315
|
end
|
|
311
316
|
end
|
|
312
317
|
|
|
@@ -109,6 +109,7 @@ module Honeybadger
|
|
|
109
109
|
def format_payload(payload)
|
|
110
110
|
{
|
|
111
111
|
query: Util::SQL.obfuscate(payload[:sql], payload[:connection]&.adapter_name),
|
|
112
|
+
cached: payload[:cached],
|
|
112
113
|
async: payload[:async]
|
|
113
114
|
}
|
|
114
115
|
end
|
|
@@ -122,13 +123,26 @@ module Honeybadger
|
|
|
122
123
|
class ActiveJobSubscriber < NotificationSubscriber
|
|
123
124
|
def format_payload(payload)
|
|
124
125
|
job = payload[:job]
|
|
126
|
+
jobs = payload[:jobs]
|
|
125
127
|
adapter = payload[:adapter]
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
job_id: job.job_id,
|
|
130
|
-
queue_name: job.queue_name
|
|
128
|
+
|
|
129
|
+
base_payload = payload.except(:job, :jobs, :adapter).merge({
|
|
130
|
+
adapter_class: adapter&.class&.to_s
|
|
131
131
|
})
|
|
132
|
+
|
|
133
|
+
if jobs
|
|
134
|
+
base_payload.merge({
|
|
135
|
+
jobs: jobs.compact.map { |j| { job_class: j.class.to_s, job_id: j.job_id, queue_name: j.queue_name } }
|
|
136
|
+
})
|
|
137
|
+
elsif job
|
|
138
|
+
base_payload.merge({
|
|
139
|
+
job_class: job.class.to_s,
|
|
140
|
+
job_id: job.job_id,
|
|
141
|
+
queue_name: job.queue_name
|
|
142
|
+
})
|
|
143
|
+
else
|
|
144
|
+
base_payload
|
|
145
|
+
end
|
|
132
146
|
end
|
|
133
147
|
end
|
|
134
148
|
|
|
@@ -15,7 +15,7 @@ module Honeybadger
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
execution do
|
|
18
|
-
|
|
18
|
+
next unless Honeybadger.config[:'exceptions.enabled']
|
|
19
19
|
require 'honeybadger/plugins/delayed_job/plugin'
|
|
20
20
|
::Delayed::Worker.plugins << Plugins::DelayedJob::Plugin
|
|
21
21
|
end
|
|
@@ -15,7 +15,7 @@ module Honeybadger
|
|
|
15
15
|
requirement { defined?(::Faktory) }
|
|
16
16
|
|
|
17
17
|
execution do
|
|
18
|
-
|
|
18
|
+
next unless Honeybadger.config[:'exceptions.enabled']
|
|
19
19
|
::Faktory.configure_worker do |faktory|
|
|
20
20
|
faktory.worker_middleware do |chain|
|
|
21
21
|
chain.prepend Middleware
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'honeybadger/notification_subscriber'
|
|
2
|
+
|
|
3
|
+
module Honeybadger
|
|
4
|
+
module Plugins
|
|
5
|
+
module Flipper
|
|
6
|
+
Plugin.register :flipper do
|
|
7
|
+
requirement { defined?(::Flipper) }
|
|
8
|
+
requirement { defined?(::ActiveSupport::Notifications) }
|
|
9
|
+
|
|
10
|
+
execution do
|
|
11
|
+
if config.load_plugin_insights?(:flipper)
|
|
12
|
+
::ActiveSupport::Notifications.subscribe(
|
|
13
|
+
'feature_operation.flipper',
|
|
14
|
+
Honeybadger::FlipperSubscriber.new
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
module Honeybadger
|
|
24
|
+
class FlipperSubscriber < NotificationSubscriber
|
|
25
|
+
def format_payload(payload)
|
|
26
|
+
payload.slice(:feature_name, :operation, :result)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def record(name, payload)
|
|
30
|
+
Honeybadger.event(name, payload)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -40,7 +40,7 @@ module Honeybadger
|
|
|
40
40
|
requirement { defined?(::Shoryuken) }
|
|
41
41
|
|
|
42
42
|
execution do
|
|
43
|
-
|
|
43
|
+
next unless Honeybadger.config[:'exceptions.enabled']
|
|
44
44
|
::Shoryuken.configure_server do |config|
|
|
45
45
|
config.server_middleware do |chain|
|
|
46
46
|
chain.add Middleware
|
|
@@ -6,7 +6,7 @@ module Honeybadger
|
|
|
6
6
|
requirement { defined?(::SuckerPunch) }
|
|
7
7
|
|
|
8
8
|
execution do
|
|
9
|
-
|
|
9
|
+
next unless Honeybadger.config[:'exceptions.enabled']
|
|
10
10
|
if SuckerPunch.respond_to?(:exception_handler=) # >= v2
|
|
11
11
|
SuckerPunch.exception_handler = ->(ex, klass, args) { Honeybadger.notify(ex, { :component => klass, :parameters => args }) }
|
|
12
12
|
else
|
data/lib/honeybadger/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +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.30.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Honeybadger Industries LLC
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-04-28 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: logger
|
|
@@ -109,6 +110,7 @@ files:
|
|
|
109
110
|
- lib/honeybadger/plugins/delayed_job.rb
|
|
110
111
|
- lib/honeybadger/plugins/delayed_job/plugin.rb
|
|
111
112
|
- lib/honeybadger/plugins/faktory.rb
|
|
113
|
+
- lib/honeybadger/plugins/flipper.rb
|
|
112
114
|
- lib/honeybadger/plugins/karafka.rb
|
|
113
115
|
- lib/honeybadger/plugins/lambda.rb
|
|
114
116
|
- lib/honeybadger/plugins/local_variables.rb
|
|
@@ -191,6 +193,7 @@ metadata:
|
|
|
191
193
|
documentation_uri: https://docs.honeybadger.io/lib/ruby/
|
|
192
194
|
homepage_uri: https://www.honeybadger.io/for/ruby/
|
|
193
195
|
source_code_uri: https://github.com/honeybadger-io/honeybadger-ruby
|
|
196
|
+
post_install_message:
|
|
194
197
|
rdoc_options:
|
|
195
198
|
- "--markup=tomdoc"
|
|
196
199
|
- "--main=README.md"
|
|
@@ -208,7 +211,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
208
211
|
- !ruby/object:Gem::Version
|
|
209
212
|
version: '0'
|
|
210
213
|
requirements: []
|
|
211
|
-
rubygems_version: 3.
|
|
214
|
+
rubygems_version: 3.0.3.1
|
|
215
|
+
signing_key:
|
|
212
216
|
specification_version: 4
|
|
213
217
|
summary: Full-stack error tracking, performance monitoring, logging, and more.
|
|
214
218
|
test_files: []
|