honeybadger 6.0.2 → 6.0.6
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 +33 -0
- data/lib/honeybadger/config/defaults.rb +7 -1
- data/lib/honeybadger/context_manager.rb +15 -14
- data/lib/honeybadger/events_worker.rb +9 -8
- data/lib/honeybadger/plugins/sidekiq.rb +14 -4
- data/lib/honeybadger/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1375027a798c5abc33beaf8eeee8098a542b322c450944021c9a89958c958b62
|
4
|
+
data.tar.gz: 9b2964f4c4665a0dac776c3b5abec5d0b043c61dc9c14ce505cb19183849b353
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38f397f7ae94d09bdbdf60cb2387637b1ded8eb57e37fba5c4c3f4becf4be50197e13a1042764c1da657fedd14be5769712a2d1b16356a5068919695caa67bb0
|
7
|
+
data.tar.gz: c329effa587e04260910f167d34094c3e89eb77b621391db40c7314408b1bc3d3ee72e595698f63dd5e02dcd0ba4cdf3fb14d4de47f7a650fbda85b430c33642
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,39 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
3
|
|
4
|
+
## [6.0.6](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.0.5...v6.0.6) (2025-08-14)
|
5
|
+
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
* reduce Insights logging ([#725](https://github.com/honeybadger-io/honeybadger-ruby/issues/725)) ([cc4756d](https://github.com/honeybadger-io/honeybadger-ruby/commit/cc4756dc86a77856588057668774fce2e1dd408e))
|
10
|
+
|
11
|
+
## [6.0.5](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.0.4...v6.0.5) (2025-08-11)
|
12
|
+
|
13
|
+
|
14
|
+
### Bug Fixes
|
15
|
+
|
16
|
+
* don't use as_json to collect Sidekiq stats ([#723](https://github.com/honeybadger-io/honeybadger-ruby/issues/723)) ([d389b2b](https://github.com/honeybadger-io/honeybadger-ruby/commit/d389b2bc2f8b5b7bcc5590946e5b0fa1a551719d)), closes [#722](https://github.com/honeybadger-io/honeybadger-ruby/issues/722)
|
17
|
+
|
18
|
+
## [6.0.4](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.0.3...v6.0.4) (2025-08-07)
|
19
|
+
|
20
|
+
|
21
|
+
### Bug Fixes
|
22
|
+
|
23
|
+
* replace context_manager mutex with a monitor ([#718](https://github.com/honeybadger-io/honeybadger-ruby/issues/718)) ([936f3eb](https://github.com/honeybadger-io/honeybadger-ruby/commit/936f3eb4e55024b55e6a1a7f3552000e5dd69eee))
|
24
|
+
|
25
|
+
|
26
|
+
### Performance Improvements
|
27
|
+
|
28
|
+
* ignore more events by default ([#720](https://github.com/honeybadger-io/honeybadger-ruby/issues/720)) ([1f7c757](https://github.com/honeybadger-io/honeybadger-ruby/commit/1f7c757beac6f443fae88aa17141bc9806480b15))
|
29
|
+
|
30
|
+
## [6.0.3](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.0.2...v6.0.3) (2025-08-04)
|
31
|
+
|
32
|
+
|
33
|
+
### Bug Fixes
|
34
|
+
|
35
|
+
* log fewer 429 responses in events worker ([#714](https://github.com/honeybadger-io/honeybadger-ruby/issues/714)) ([91c7fc2](https://github.com/honeybadger-io/honeybadger-ruby/commit/91c7fc2a0f38d16e076f03c45578afec4a536a2a)), closes [#713](https://github.com/honeybadger-io/honeybadger-ruby/issues/713)
|
36
|
+
|
4
37
|
## [6.0.2](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.0.1...v6.0.2) (2025-07-24)
|
5
38
|
|
6
39
|
|
@@ -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
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "honeybadger/conversions"
|
2
|
+
require "monitor"
|
2
3
|
|
3
4
|
module Honeybadger
|
4
5
|
# @api private
|
@@ -10,7 +11,7 @@ module Honeybadger
|
|
10
11
|
end
|
11
12
|
|
12
13
|
def initialize
|
13
|
-
@
|
14
|
+
@monitor = Monitor.new
|
14
15
|
_initialize
|
15
16
|
end
|
16
17
|
|
@@ -22,7 +23,7 @@ module Honeybadger
|
|
22
23
|
|
23
24
|
def set_context(hash, &block)
|
24
25
|
local = block_given?
|
25
|
-
@
|
26
|
+
@monitor.synchronize do
|
26
27
|
@global_context ||= {}
|
27
28
|
@local_context ||= []
|
28
29
|
|
@@ -39,13 +40,13 @@ module Honeybadger
|
|
39
40
|
begin
|
40
41
|
yield
|
41
42
|
ensure
|
42
|
-
@
|
43
|
+
@monitor.synchronize { @local_context&.pop }
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
47
48
|
def get_context
|
48
|
-
@
|
49
|
+
@monitor.synchronize do
|
49
50
|
return @global_context unless @local_context
|
50
51
|
|
51
52
|
@global_context.merge(@local_context.inject({}, :merge))
|
@@ -53,7 +54,7 @@ module Honeybadger
|
|
53
54
|
end
|
54
55
|
|
55
56
|
def clear_context
|
56
|
-
@
|
57
|
+
@monitor.synchronize do
|
57
58
|
@global_context = nil
|
58
59
|
@local_context = nil
|
59
60
|
end
|
@@ -61,7 +62,7 @@ module Honeybadger
|
|
61
62
|
|
62
63
|
def set_event_context(hash, &block)
|
63
64
|
local = block_given?
|
64
|
-
@
|
65
|
+
@monitor.synchronize do
|
65
66
|
@global_event_context ||= {}
|
66
67
|
@local_event_context ||= []
|
67
68
|
|
@@ -78,13 +79,13 @@ module Honeybadger
|
|
78
79
|
begin
|
79
80
|
yield
|
80
81
|
ensure
|
81
|
-
@
|
82
|
+
@monitor.synchronize { @local_event_context&.pop }
|
82
83
|
end
|
83
84
|
end
|
84
85
|
end
|
85
86
|
|
86
87
|
def get_event_context
|
87
|
-
@
|
88
|
+
@monitor.synchronize do
|
88
89
|
return @global_event_context unless @local_event_context
|
89
90
|
|
90
91
|
@global_event_context.merge(@local_event_context.inject({}, :merge))
|
@@ -92,26 +93,26 @@ module Honeybadger
|
|
92
93
|
end
|
93
94
|
|
94
95
|
def clear_event_context
|
95
|
-
@
|
96
|
+
@monitor.synchronize do
|
96
97
|
@global_event_context = nil
|
97
98
|
@local_event_context = nil
|
98
99
|
end
|
99
100
|
end
|
100
101
|
|
101
102
|
def set_rack_env(env)
|
102
|
-
@
|
103
|
+
@monitor.synchronize { @rack_env = env }
|
103
104
|
end
|
104
105
|
|
105
106
|
def get_rack_env
|
106
|
-
@
|
107
|
+
@monitor.synchronize { @rack_env }
|
107
108
|
end
|
108
109
|
|
109
110
|
def set_request_id(request_id)
|
110
|
-
@
|
111
|
+
@monitor.synchronize { @request_id = request_id }
|
111
112
|
end
|
112
113
|
|
113
114
|
def get_request_id
|
114
|
-
@
|
115
|
+
@monitor.synchronize { @request_id }
|
115
116
|
end
|
116
117
|
|
117
118
|
private
|
@@ -119,7 +120,7 @@ module Honeybadger
|
|
119
120
|
attr_accessor :custom, :rack_env, :request_id
|
120
121
|
|
121
122
|
def _initialize
|
122
|
-
@
|
123
|
+
@monitor.synchronize do
|
123
124
|
@global_context = nil
|
124
125
|
@local_context = nil
|
125
126
|
@global_event_context = nil
|
@@ -284,27 +284,28 @@ module Honeybadger
|
|
284
284
|
case response.code
|
285
285
|
when 429, 503
|
286
286
|
throttle = inc_throttle
|
287
|
-
|
287
|
+
debug { sprintf("Insights Event send failed: project is sending too many events. code=%s throttle=%s interval=%s", response.code, throttle, throttle_interval) }
|
288
|
+
suspend(3600)
|
288
289
|
when 402
|
289
|
-
warn { sprintf("Event send failed: payment is required. code=%s", response.code) }
|
290
|
+
warn { sprintf("Insights Event send failed: payment is required. code=%s", response.code) }
|
290
291
|
suspend(3600)
|
291
292
|
when 403
|
292
|
-
warn { sprintf("Event send failed: API key is invalid. code=%s", response.code) }
|
293
|
+
warn { sprintf("Insights Event send failed: API key is invalid. code=%s", response.code) }
|
293
294
|
suspend(3600)
|
294
295
|
when 413
|
295
|
-
warn { sprintf("Event send failed: Payload is too large. code=%s", response.code) }
|
296
|
+
warn { sprintf("Insights Event send failed: Payload is too large. code=%s", response.code) }
|
296
297
|
when 201
|
297
298
|
if (throttle = dec_throttle)
|
298
|
-
debug { sprintf("Success ⚡ Event sent code=%s throttle=%s interval=%s", response.code, throttle, throttle_interval) }
|
299
|
+
debug { sprintf("Success ⚡ Insights Event sent code=%s throttle=%s interval=%s", response.code, throttle, throttle_interval) }
|
299
300
|
else
|
300
|
-
debug { sprintf("Success ⚡ Event sent code=%s", response.code) }
|
301
|
+
debug { sprintf("Success ⚡ Insights Event sent code=%s", response.code) }
|
301
302
|
end
|
302
303
|
when :stubbed
|
303
304
|
info { "Success ⚡ Development mode is enabled; This event will be sent after app is deployed." }
|
304
305
|
when :error
|
305
|
-
warn { sprintf("Event send failed: an unknown error occurred. code=%s error=%s", response.code, response.message.to_s.dump) }
|
306
|
+
warn { sprintf("Insights Event send failed: an unknown error occurred. code=%s error=%s", response.code, response.message.to_s.dump) }
|
306
307
|
else
|
307
|
-
warn { sprintf("Event send failed: unknown response from server. code=%s", response.code) }
|
308
|
+
warn { sprintf("Insights Event send failed: unknown response from server. code=%s", response.code) }
|
308
309
|
end
|
309
310
|
end
|
310
311
|
|
@@ -175,8 +175,18 @@ module Honeybadger
|
|
175
175
|
|
176
176
|
collect_sidekiq_stats = -> do
|
177
177
|
stats = ::Sidekiq::Stats.new
|
178
|
-
data =
|
179
|
-
|
178
|
+
data = {
|
179
|
+
stats: {
|
180
|
+
processed: stats.processed,
|
181
|
+
failed: stats.failed,
|
182
|
+
scheduled_size: stats.scheduled_size,
|
183
|
+
retry_size: stats.retry_size,
|
184
|
+
dead_size: stats.dead_size,
|
185
|
+
processes_size: stats.processes_size,
|
186
|
+
default_queue_latency: stats.default_queue_latency
|
187
|
+
},
|
188
|
+
queues: {}
|
189
|
+
}
|
180
190
|
|
181
191
|
::Sidekiq::Queue.all.each do |queue|
|
182
192
|
data[:queues][queue.name] ||= {}
|
@@ -216,13 +226,13 @@ module Honeybadger
|
|
216
226
|
stats = collect_sidekiq_stats.call
|
217
227
|
|
218
228
|
if Honeybadger.config.load_plugin_insights_events?(:sidekiq)
|
219
|
-
Honeybadger.event("stats.sidekiq", stats.except(
|
229
|
+
Honeybadger.event("stats.sidekiq", stats.except(:stats).merge(stats[:stats]))
|
220
230
|
end
|
221
231
|
|
222
232
|
if Honeybadger.config.load_plugin_insights_metrics?(:sidekiq)
|
223
233
|
metric_source "sidekiq"
|
224
234
|
|
225
|
-
stats[
|
235
|
+
stats[:stats].each do |name, value|
|
226
236
|
gauge name, value: value
|
227
237
|
end
|
228
238
|
|
data/lib/honeybadger/version.rb
CHANGED