honeybadger 6.1.3 → 6.2.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 +13 -0
- data/lib/honeybadger/breadcrumbs/logging.rb +1 -1
- data/lib/honeybadger/config/defaults.rb +25 -0
- data/lib/honeybadger/config.rb +40 -17
- data/lib/honeybadger/karafka.rb +10 -10
- data/lib/honeybadger/notification_subscriber.rb +43 -34
- data/lib/honeybadger/plugins/active_agent.rb +38 -0
- data/lib/honeybadger/plugins/autotuner.rb +2 -2
- data/lib/honeybadger/plugins/flipper.rb +33 -0
- data/lib/honeybadger/plugins/net_http.rb +2 -2
- data/lib/honeybadger/plugins/rails.rb +2 -0
- data/lib/honeybadger/plugins/sidekiq.rb +5 -5
- data/lib/honeybadger/plugins/solid_queue.rb +2 -2
- data/lib/honeybadger/version.rb +1 -1
- data/lib/puma/plugin/honeybadger.rb +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b0d64d7db88ff595c07937d6f9f99c511fa7660d774117e74cdba8037754d428
|
|
4
|
+
data.tar.gz: d2b444b432dfb2641912afb6b464e4b0d92e09cd828bf3ad2e358e6d8ecb0b35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4eb4640f40d076f316dc1e6ac86a9ba58b5de7a1c76ab15072746ab1d591921ee02a7136453da8dfb09783aa01520ab961b0eba48e82c9125ccde6c673004a3
|
|
7
|
+
data.tar.gz: d9edcfeabcae6c07b44ac289e31ba83abbf7743be7371f2d24c32ecba866bcacfcfbc5ad3c7dd5ae9e920336bda9dd3d516b5dde30a40c8925eb913f91b641a8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## [6.2.0](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.1.3...v6.2.0) (2025-12-11)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* add Active Agent monitoring plugin ([#754](https://github.com/honeybadger-io/honeybadger-ruby/issues/754)) ([e78cd04](https://github.com/honeybadger-io/honeybadger-ruby/commit/e78cd0419eec02979872500c81b30e274396ca34))
|
|
10
|
+
* send Flipper events to Insights ([#758](https://github.com/honeybadger-io/honeybadger-ruby/issues/758)) ([12d5010](https://github.com/honeybadger-io/honeybadger-ruby/commit/12d501009033884dd77c0b4daedd12cfff1c5cae))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* handle nil messages in Breadcrumbs::LogWrapper ([#757](https://github.com/honeybadger-io/honeybadger-ruby/issues/757)) ([b141f14](https://github.com/honeybadger-io/honeybadger-ruby/commit/b141f14a873d16a8be9b087c8720a734929aca9f))
|
|
16
|
+
|
|
4
17
|
## [6.1.3](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.1.2...v6.1.3) (2025-10-28)
|
|
5
18
|
|
|
6
19
|
|
|
@@ -12,7 +12,7 @@ module Honeybadger
|
|
|
12
12
|
elsif message.nil?
|
|
13
13
|
message, progname = [progname, nil]
|
|
14
14
|
end
|
|
15
|
-
message &&= Util::Sanitizer.sanitize(message.to_s)
|
|
15
|
+
message &&= Util::Sanitizer.sanitize(message.to_s)&.strip
|
|
16
16
|
unless should_ignore_log?(message, progname)
|
|
17
17
|
Honeybadger.add_breadcrumb(message, category: :log, metadata: {
|
|
18
18
|
severity: format_severity(severity),
|
|
@@ -325,11 +325,21 @@ module Honeybadger
|
|
|
325
325
|
default: false,
|
|
326
326
|
type: Boolean
|
|
327
327
|
},
|
|
328
|
+
"active_agent.insights.enabled": {
|
|
329
|
+
description: "Enable automatic data collection for Active Agent.",
|
|
330
|
+
default: true,
|
|
331
|
+
type: Boolean
|
|
332
|
+
},
|
|
328
333
|
"active_job.attempt_threshold": {
|
|
329
334
|
description: "The number of attempts before notifications will be sent.",
|
|
330
335
|
default: 0,
|
|
331
336
|
type: Integer
|
|
332
337
|
},
|
|
338
|
+
"active_job.insights.enabled": {
|
|
339
|
+
description: "Enable automatic data collection for Active Job.",
|
|
340
|
+
default: true,
|
|
341
|
+
type: Boolean
|
|
342
|
+
},
|
|
333
343
|
"delayed_job.attempt_threshold": {
|
|
334
344
|
description: "The number of attempts before notifications will be sent.",
|
|
335
345
|
default: 0,
|
|
@@ -503,6 +513,11 @@ module Honeybadger
|
|
|
503
513
|
default: 60,
|
|
504
514
|
type: Integer
|
|
505
515
|
},
|
|
516
|
+
"puma.insights.enabled": {
|
|
517
|
+
description: "Enable automatic data collection for Puma.",
|
|
518
|
+
default: true,
|
|
519
|
+
type: Boolean
|
|
520
|
+
},
|
|
506
521
|
"puma.insights.events": {
|
|
507
522
|
description: "Enable automatic event capturing for Puma stats.",
|
|
508
523
|
default: true,
|
|
@@ -518,6 +533,11 @@ module Honeybadger
|
|
|
518
533
|
default: 1,
|
|
519
534
|
type: Integer
|
|
520
535
|
},
|
|
536
|
+
"autotuner.insights.enabled": {
|
|
537
|
+
description: "Enable automatic data collection for Autotuner.",
|
|
538
|
+
default: true,
|
|
539
|
+
type: Boolean
|
|
540
|
+
},
|
|
521
541
|
"autotuner.insights.events": {
|
|
522
542
|
description: "Enable automatic event capturing for Autotuner stats.",
|
|
523
543
|
default: true,
|
|
@@ -527,6 +547,11 @@ module Honeybadger
|
|
|
527
547
|
description: "Enable automatic metric data aggregation for Autotuner stats.",
|
|
528
548
|
default: false,
|
|
529
549
|
type: Boolean
|
|
550
|
+
},
|
|
551
|
+
"flipper.insights.enabled": {
|
|
552
|
+
description: "Enable automatic data collection for Flipper.",
|
|
553
|
+
default: true,
|
|
554
|
+
type: Boolean
|
|
530
555
|
}
|
|
531
556
|
}.freeze
|
|
532
557
|
|
data/lib/honeybadger/config.rb
CHANGED
|
@@ -66,6 +66,7 @@ module Honeybadger
|
|
|
66
66
|
self.env = Env.new(env).freeze
|
|
67
67
|
load_config_from_disk { |yaml| self.yaml = yaml.freeze }
|
|
68
68
|
detect_revision!
|
|
69
|
+
process_deprecations!
|
|
69
70
|
@loaded = true
|
|
70
71
|
self
|
|
71
72
|
end
|
|
@@ -301,24 +302,10 @@ module Honeybadger
|
|
|
301
302
|
self[:"#{name}.insights.collection_interval"]
|
|
302
303
|
end
|
|
303
304
|
|
|
304
|
-
def load_plugin_insights?(name)
|
|
305
|
+
def load_plugin_insights?(name, feature: nil)
|
|
305
306
|
return false unless insights_enabled?
|
|
306
|
-
return
|
|
307
|
-
|
|
308
|
-
end
|
|
309
|
-
|
|
310
|
-
def load_plugin_insights_events?(name)
|
|
311
|
-
return false unless insights_enabled?
|
|
312
|
-
return false unless load_plugin_insights?(name)
|
|
313
|
-
return true if self[:"#{name}.insights.events"].nil?
|
|
314
|
-
!!self[:"#{name}.insights.events"]
|
|
315
|
-
end
|
|
316
|
-
|
|
317
|
-
def load_plugin_insights_metrics?(name)
|
|
318
|
-
return false unless insights_enabled?
|
|
319
|
-
return false unless load_plugin_insights?(name)
|
|
320
|
-
return true if self[:"#{name}.insights.metrics"].nil?
|
|
321
|
-
!!self[:"#{name}.insights.metrics"]
|
|
307
|
+
return false unless self[:"#{name}.insights.enabled"]
|
|
308
|
+
feature.nil? || self[:"#{name}.insights.#{feature}"]
|
|
322
309
|
end
|
|
323
310
|
|
|
324
311
|
def root_regexp
|
|
@@ -365,6 +352,42 @@ module Honeybadger
|
|
|
365
352
|
set(:revision, Util::Revision.detect(self[:root]))
|
|
366
353
|
end
|
|
367
354
|
|
|
355
|
+
# When an option includes the `deprecated` property, warn the logger with
|
|
356
|
+
# the provided message (or a default message if `true`). If the
|
|
357
|
+
# `deprecated_by` property is present, automatically rename the option,
|
|
358
|
+
# removing the old key from the source.
|
|
359
|
+
def process_deprecations!
|
|
360
|
+
IVARS.each do |var|
|
|
361
|
+
source = instance_variable_get(var)
|
|
362
|
+
|
|
363
|
+
# We don't need to update the source unless there are deprecated_by options.
|
|
364
|
+
updated_source = nil
|
|
365
|
+
|
|
366
|
+
source.each_pair do |deprecated_key, value|
|
|
367
|
+
next unless (deprecated = OPTIONS.dig(deprecated_key, :deprecated))
|
|
368
|
+
deprecated_by = OPTIONS.dig(deprecated_key, :deprecated_by)
|
|
369
|
+
|
|
370
|
+
msg = if deprecated.is_a?(String)
|
|
371
|
+
deprecated
|
|
372
|
+
elsif deprecated_by
|
|
373
|
+
"The `#{deprecated_key}` option is deprecated. Use `#{deprecated_by}` instead."
|
|
374
|
+
else
|
|
375
|
+
"The `#{deprecated_key}` option is deprecated and has no effect."
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
warn("DEPRECATED: #{msg} config_source=#{var.to_s.delete_prefix("@")}")
|
|
379
|
+
|
|
380
|
+
if deprecated_by
|
|
381
|
+
updated_source ||= source.dup
|
|
382
|
+
updated_source[deprecated_by] = value unless updated_source.key?(deprecated_by)
|
|
383
|
+
updated_source.delete(deprecated_key)
|
|
384
|
+
end
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
instance_variable_set(var, updated_source.freeze) if updated_source
|
|
388
|
+
end
|
|
389
|
+
end
|
|
390
|
+
|
|
368
391
|
def log_path
|
|
369
392
|
return if log_stdout?
|
|
370
393
|
return if !self[:"logging.path"]
|
data/lib/honeybadger/karafka.rb
CHANGED
|
@@ -69,11 +69,11 @@ module Honeybadger
|
|
|
69
69
|
#
|
|
70
70
|
# @param event [Karafka::Core::Monitoring::Event]
|
|
71
71
|
def on_statistics_emitted(event)
|
|
72
|
-
if Honeybadger.config.
|
|
72
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :events)
|
|
73
73
|
Honeybadger.event("statistics_emitted.karafka", event.payload)
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
return unless Honeybadger.config.
|
|
76
|
+
return unless Honeybadger.config.load_plugin_insights?(:karafka, feature: :metrics)
|
|
77
77
|
|
|
78
78
|
statistics = event[:statistics]
|
|
79
79
|
consumer_group_id = event[:consumer_group_id]
|
|
@@ -126,11 +126,11 @@ module Honeybadger
|
|
|
126
126
|
extra_tags.merge!(consumer_tags(event.payload[:caller]))
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
-
if Honeybadger.config.
|
|
129
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :events)
|
|
130
130
|
Honeybadger.event("error.occurred.karafka", error: event[:error], **extra_tags)
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
-
if Honeybadger.config.
|
|
133
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :metrics)
|
|
134
134
|
increment_counter("error_occurred", value: 1, **extra_tags)
|
|
135
135
|
end
|
|
136
136
|
end
|
|
@@ -144,7 +144,7 @@ module Honeybadger
|
|
|
144
144
|
consumer_group_id = event[:subscription_group].consumer_group.id
|
|
145
145
|
extra_tags = {consumer_group: consumer_group_id}
|
|
146
146
|
|
|
147
|
-
if Honeybadger.config.
|
|
147
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :metrics)
|
|
148
148
|
histogram("listener_polling_time_taken", value: time_taken, **extra_tags)
|
|
149
149
|
histogram("listener_polling_messages", value: messages_count, **extra_tags)
|
|
150
150
|
end
|
|
@@ -160,7 +160,7 @@ module Honeybadger
|
|
|
160
160
|
|
|
161
161
|
tags = consumer_tags(consumer)
|
|
162
162
|
|
|
163
|
-
if Honeybadger.config.
|
|
163
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :events)
|
|
164
164
|
event_context = tags.merge({
|
|
165
165
|
consumer: consumer.class.name,
|
|
166
166
|
duration: event[:time],
|
|
@@ -171,7 +171,7 @@ module Honeybadger
|
|
|
171
171
|
Honeybadger.event("consumer.consumed.karafka", event_context)
|
|
172
172
|
end
|
|
173
173
|
|
|
174
|
-
if Honeybadger.config.
|
|
174
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :metrics)
|
|
175
175
|
increment_counter("consumer_messages", value: messages.count, **tags)
|
|
176
176
|
increment_counter("consumer_batches", value: 1, **tags)
|
|
177
177
|
gauge("consumer_offset", value: metadata.last_offset, **tags)
|
|
@@ -192,7 +192,7 @@ module Honeybadger
|
|
|
192
192
|
#
|
|
193
193
|
# @param event [Karafka::Core::Monitoring::Event]
|
|
194
194
|
def on_consumer_#{after}(event)
|
|
195
|
-
if Honeybadger.config.
|
|
195
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :metrics)
|
|
196
196
|
tags = consumer_tags(event.payload[:caller])
|
|
197
197
|
increment_counter('consumer_#{name}', value: 1, **tags)
|
|
198
198
|
end
|
|
@@ -205,7 +205,7 @@ module Honeybadger
|
|
|
205
205
|
def on_worker_process(event)
|
|
206
206
|
jq_stats = event[:jobs_queue].statistics
|
|
207
207
|
|
|
208
|
-
if Honeybadger.config.
|
|
208
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :metrics)
|
|
209
209
|
gauge("worker_total_threads", value: ::Karafka::App.config.concurrency)
|
|
210
210
|
histogram("worker_processing", value: jq_stats[:busy])
|
|
211
211
|
histogram("worker_enqueued_jobs", value: jq_stats[:enqueued])
|
|
@@ -218,7 +218,7 @@ module Honeybadger
|
|
|
218
218
|
def on_worker_processed(event)
|
|
219
219
|
jq_stats = event[:jobs_queue].statistics
|
|
220
220
|
|
|
221
|
-
if Honeybadger.config.
|
|
221
|
+
if Honeybadger.config.load_plugin_insights?(:karafka, feature: :metrics)
|
|
222
222
|
histogram("worker_processing", value: jq_stats[:busy])
|
|
223
223
|
end
|
|
224
224
|
end
|
|
@@ -16,23 +16,40 @@ module Honeybadger
|
|
|
16
16
|
payload = {
|
|
17
17
|
instrumenter_id: id,
|
|
18
18
|
duration: ((finish_time - payload.delete(:_start_time)) * 1000).round(2)
|
|
19
|
-
}.merge(format_payload(payload).compact)
|
|
19
|
+
}.merge(format_payload(name, payload).compact)
|
|
20
20
|
|
|
21
21
|
record(name, payload)
|
|
22
|
+
record_metrics(name, payload)
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
def record(name, payload)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
end
|
|
26
|
+
Honeybadger.event(name, payload)
|
|
27
|
+
end
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
def record_metrics(name, payload)
|
|
30
|
+
# noop
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def process?(name, payload)
|
|
34
|
+
true
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def format_payload(name, payload)
|
|
38
|
+
payload
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class RailsSubscriber < NotificationSubscriber
|
|
43
|
+
def record(name, payload)
|
|
44
|
+
return unless Honeybadger.config.load_plugin_insights?(:rails, feature: :events)
|
|
45
|
+
Honeybadger.event(name, payload)
|
|
33
46
|
end
|
|
34
47
|
|
|
35
48
|
def record_metrics(name, payload)
|
|
49
|
+
return unless Honeybadger.config.load_plugin_insights?(:rails, feature: :metrics)
|
|
50
|
+
|
|
51
|
+
metric_source "rails"
|
|
52
|
+
|
|
36
53
|
case name
|
|
37
54
|
when "sql.active_record"
|
|
38
55
|
gauge("duration.sql.active_record", value: payload[:duration], **payload.slice(:query))
|
|
@@ -46,38 +63,30 @@ module Honeybadger
|
|
|
46
63
|
gauge("duration.#{name}", value: payload[:duration], **payload.slice(:store, :key))
|
|
47
64
|
end
|
|
48
65
|
end
|
|
49
|
-
|
|
50
|
-
def process?(event, payload)
|
|
51
|
-
true
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def format_payload(payload)
|
|
55
|
-
payload
|
|
56
|
-
end
|
|
57
66
|
end
|
|
58
67
|
|
|
59
|
-
class ActionControllerSubscriber <
|
|
60
|
-
def format_payload(payload)
|
|
68
|
+
class ActionControllerSubscriber < RailsSubscriber
|
|
69
|
+
def format_payload(_name, payload)
|
|
61
70
|
payload.except(:headers, :request, :response)
|
|
62
71
|
end
|
|
63
72
|
end
|
|
64
73
|
|
|
65
|
-
class ActionControllerCacheSubscriber <
|
|
66
|
-
def format_payload(payload)
|
|
74
|
+
class ActionControllerCacheSubscriber < RailsSubscriber
|
|
75
|
+
def format_payload(_name, payload)
|
|
67
76
|
payload[:key] = ::ActiveSupport::Cache.expand_cache_key(payload[:key]) if payload[:key]
|
|
68
77
|
payload
|
|
69
78
|
end
|
|
70
79
|
end
|
|
71
80
|
|
|
72
|
-
class ActiveSupportCacheSubscriber <
|
|
73
|
-
def format_payload(payload)
|
|
81
|
+
class ActiveSupportCacheSubscriber < RailsSubscriber
|
|
82
|
+
def format_payload(_name, payload)
|
|
74
83
|
payload[:key] = ::ActiveSupport::Cache.expand_cache_key(payload[:key]) if payload[:key]
|
|
75
84
|
payload
|
|
76
85
|
end
|
|
77
86
|
end
|
|
78
87
|
|
|
79
|
-
class ActiveSupportCacheMultiSubscriber <
|
|
80
|
-
def format_payload(payload)
|
|
88
|
+
class ActiveSupportCacheMultiSubscriber < RailsSubscriber
|
|
89
|
+
def format_payload(_name, payload)
|
|
81
90
|
payload[:key] = expand_cache_keys_from_payload(payload[:key])
|
|
82
91
|
payload[:hits] = expand_cache_keys_from_payload(payload[:hits])
|
|
83
92
|
payload
|
|
@@ -94,10 +103,10 @@ module Honeybadger
|
|
|
94
103
|
end
|
|
95
104
|
end
|
|
96
105
|
|
|
97
|
-
class ActionViewSubscriber <
|
|
106
|
+
class ActionViewSubscriber < RailsSubscriber
|
|
98
107
|
PROJECT_ROOT = defined?(::Rails) ? ::Rails.root.to_s : ""
|
|
99
108
|
|
|
100
|
-
def format_payload(payload)
|
|
109
|
+
def format_payload(_name, payload)
|
|
101
110
|
{
|
|
102
111
|
view: payload[:identifier].to_s.gsub(PROJECT_ROOT, "[PROJECT_ROOT]"),
|
|
103
112
|
layout: payload[:layout]
|
|
@@ -105,8 +114,8 @@ module Honeybadger
|
|
|
105
114
|
end
|
|
106
115
|
end
|
|
107
116
|
|
|
108
|
-
class ActiveRecordSubscriber <
|
|
109
|
-
def format_payload(payload)
|
|
117
|
+
class ActiveRecordSubscriber < RailsSubscriber
|
|
118
|
+
def format_payload(_name, payload)
|
|
110
119
|
{
|
|
111
120
|
query: Util::SQL.obfuscate(payload[:sql], payload[:connection]&.adapter_name),
|
|
112
121
|
cached: payload[:cached],
|
|
@@ -114,14 +123,14 @@ module Honeybadger
|
|
|
114
123
|
}
|
|
115
124
|
end
|
|
116
125
|
|
|
117
|
-
def process?(
|
|
126
|
+
def process?(name, payload)
|
|
118
127
|
return false if payload[:name] == "SCHEMA"
|
|
119
128
|
true
|
|
120
129
|
end
|
|
121
130
|
end
|
|
122
131
|
|
|
123
|
-
class ActiveJobSubscriber <
|
|
124
|
-
def format_payload(payload)
|
|
132
|
+
class ActiveJobSubscriber < RailsSubscriber
|
|
133
|
+
def format_payload(_name, payload)
|
|
125
134
|
job = payload[:job]
|
|
126
135
|
jobs = payload[:jobs]
|
|
127
136
|
adapter = payload[:adapter]
|
|
@@ -146,8 +155,8 @@ module Honeybadger
|
|
|
146
155
|
end
|
|
147
156
|
end
|
|
148
157
|
|
|
149
|
-
class ActionMailerSubscriber <
|
|
150
|
-
def format_payload(payload)
|
|
158
|
+
class ActionMailerSubscriber < RailsSubscriber
|
|
159
|
+
def format_payload(_name, payload)
|
|
151
160
|
# Don't include the mail object in the payload...
|
|
152
161
|
mail = payload.delete(:mail)
|
|
153
162
|
|
|
@@ -162,6 +171,6 @@ module Honeybadger
|
|
|
162
171
|
end
|
|
163
172
|
end
|
|
164
173
|
|
|
165
|
-
class ActiveStorageSubscriber <
|
|
174
|
+
class ActiveStorageSubscriber < RailsSubscriber
|
|
166
175
|
end
|
|
167
176
|
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require "honeybadger/plugin"
|
|
2
|
+
require "honeybadger/notification_subscriber"
|
|
3
|
+
|
|
4
|
+
module Honeybadger
|
|
5
|
+
module Plugins
|
|
6
|
+
module ActiveAgent
|
|
7
|
+
|
|
8
|
+
Plugin.register :active_agent do
|
|
9
|
+
requirement { defined?(::ActiveAgent) }
|
|
10
|
+
requirement { defined?(::ActiveSupport::Notifications) }
|
|
11
|
+
|
|
12
|
+
execution do
|
|
13
|
+
if config.load_plugin_insights?(:active_agent)
|
|
14
|
+
::ActiveSupport::Notifications.subscribe(
|
|
15
|
+
/(prompt|embed|stream_open|stream_close|tool_call|process)\.active_agent/,
|
|
16
|
+
Honeybadger::ActiveAgentSubscriber.new
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
module Honeybadger
|
|
26
|
+
class ActiveAgentSubscriber < NotificationSubscriber
|
|
27
|
+
def format_payload(name, payload)
|
|
28
|
+
case name
|
|
29
|
+
when "prompt.active_agent"
|
|
30
|
+
payload.slice(:provider, :provider_module, :trace_id, :model, :message_count, :stream, :usage, :finish_reason, :response_model, :response_id, :temperature, :max_tokens, :top_p, :tool_count, :has_instructions)
|
|
31
|
+
when "embed.active_agent"
|
|
32
|
+
payload.slice(:provider, :provider_module, :trace_id, :model, :input_size, :embedding_count, :usage, :response_model, :response_id, :encoding_format, :dimensions)
|
|
33
|
+
else
|
|
34
|
+
payload
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -15,11 +15,11 @@ module Honeybadger
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
::Autotuner.metrics_reporter = proc do |metrics|
|
|
18
|
-
if config.
|
|
18
|
+
if config.load_plugin_insights?(:autotuner, feature: :events)
|
|
19
19
|
Honeybadger.event("stats.autotuner", metrics)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
if config.
|
|
22
|
+
if config.load_plugin_insights?(:autotuner, feature: :metrics)
|
|
23
23
|
metric_source "autotuner"
|
|
24
24
|
metrics.each do |key, val|
|
|
25
25
|
gauge key, -> { val }
|
|
@@ -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(_name, 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
|
|
@@ -24,11 +24,11 @@ module Honeybadger
|
|
|
24
24
|
status: response_data.code.to_i
|
|
25
25
|
}.merge(parsed_uri_data(request_data))
|
|
26
26
|
|
|
27
|
-
if @@hb_config.
|
|
27
|
+
if @@hb_config.load_plugin_insights?(:net_http, feature: :events)
|
|
28
28
|
Honeybadger.event("request.net_http", context)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
if @@hb_config.
|
|
31
|
+
if @@hb_config.load_plugin_insights?(:net_http, feature: :metrics)
|
|
32
32
|
context.delete(:url)
|
|
33
33
|
Honeybadger.gauge("duration.request", context.merge(metric_source: "net_http"))
|
|
34
34
|
end
|
|
@@ -84,6 +84,8 @@ module Honeybadger
|
|
|
84
84
|
requirement { defined?(::Rails.application) && ::Rails.application }
|
|
85
85
|
|
|
86
86
|
execution do
|
|
87
|
+
# These subscribers handle events and metrics. See the additional
|
|
88
|
+
# config checks in lib/honeybadger/notification_subscriber.rb
|
|
87
89
|
if config.load_plugin_insights?(:rails)
|
|
88
90
|
::ActiveSupport::Notifications.subscribe(/(process_action|send_file|redirect_to|halted_callback|unpermitted_parameters)\.action_controller/, Honeybadger::ActionControllerSubscriber.new)
|
|
89
91
|
::ActiveSupport::Notifications.subscribe(/(write_fragment|read_fragment|expire_fragment|exist_fragment\?)\.action_controller/, Honeybadger::ActionControllerCacheSubscriber.new)
|
|
@@ -39,11 +39,11 @@ module Honeybadger
|
|
|
39
39
|
ensure
|
|
40
40
|
context[:duration] = duration
|
|
41
41
|
context[:status] = status
|
|
42
|
-
if Honeybadger.config.
|
|
42
|
+
if Honeybadger.config.load_plugin_insights?(:sidekiq, feature: :events)
|
|
43
43
|
Honeybadger.event("perform.sidekiq", context)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
if Honeybadger.config.
|
|
46
|
+
if Honeybadger.config.load_plugin_insights?(:sidekiq, feature: :metrics)
|
|
47
47
|
metric_source "sidekiq"
|
|
48
48
|
gauge "perform", context.slice(:worker, :queue, :duration)
|
|
49
49
|
end
|
|
@@ -60,7 +60,7 @@ module Honeybadger
|
|
|
60
60
|
queue: queue
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
if Honeybadger.config.
|
|
63
|
+
if Honeybadger.config.load_plugin_insights?(:sidekiq, feature: :events)
|
|
64
64
|
Honeybadger.event("enqueue.sidekiq", context)
|
|
65
65
|
end
|
|
66
66
|
|
|
@@ -225,11 +225,11 @@ module Honeybadger
|
|
|
225
225
|
if config.cluster_collection?(:sidekiq) && (leader_checker.nil? || leader_checker.collect?)
|
|
226
226
|
stats = collect_sidekiq_stats.call
|
|
227
227
|
|
|
228
|
-
if Honeybadger.config.
|
|
228
|
+
if Honeybadger.config.load_plugin_insights?(:sidekiq, feature: :events)
|
|
229
229
|
Honeybadger.event("stats.sidekiq", stats.except(:stats).merge(stats[:stats]))
|
|
230
230
|
end
|
|
231
231
|
|
|
232
|
-
if Honeybadger.config.
|
|
232
|
+
if Honeybadger.config.load_plugin_insights?(:sidekiq, feature: :metrics)
|
|
233
233
|
metric_source "sidekiq"
|
|
234
234
|
|
|
235
235
|
stats[:stats].each do |name, value|
|
|
@@ -30,11 +30,11 @@ module Honeybadger
|
|
|
30
30
|
if config.cluster_collection?(:solid_queue)
|
|
31
31
|
stats = collect_solid_queue_stats.call
|
|
32
32
|
|
|
33
|
-
if Honeybadger.config.
|
|
33
|
+
if Honeybadger.config.load_plugin_insights?(:solid_queue, feature: :events)
|
|
34
34
|
Honeybadger.event("stats.solid_queue", stats.except(:stats).merge(stats[:stats]))
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
if Honeybadger.config.
|
|
37
|
+
if Honeybadger.config.load_plugin_insights?(:solid_queue, feature: :metrics)
|
|
38
38
|
metric_source "solid_queue"
|
|
39
39
|
stats[:stats].each do |stat_name, value|
|
|
40
40
|
gauge stat_name, value: value
|
data/lib/honeybadger/version.rb
CHANGED
|
@@ -39,11 +39,11 @@ module Honeybadger
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def record_puma_stats(stats, context = {})
|
|
42
|
-
if Honeybadger.config.
|
|
42
|
+
if Honeybadger.config.load_plugin_insights?(:puma, feature: :events)
|
|
43
43
|
Honeybadger.event("stats.puma", context.merge(stats))
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
if Honeybadger.config.
|
|
46
|
+
if Honeybadger.config.load_plugin_insights?(:puma, feature: :metrics)
|
|
47
47
|
STATS_KEYS.each do |stat|
|
|
48
48
|
gauge stat, context, -> { stats[stat] } if stats[stat]
|
|
49
49
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: honeybadger
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Honeybadger Industries LLC
|
|
@@ -103,12 +103,14 @@ files:
|
|
|
103
103
|
- lib/honeybadger/notice.rb
|
|
104
104
|
- lib/honeybadger/notification_subscriber.rb
|
|
105
105
|
- lib/honeybadger/plugin.rb
|
|
106
|
+
- lib/honeybadger/plugins/active_agent.rb
|
|
106
107
|
- lib/honeybadger/plugins/active_job.rb
|
|
107
108
|
- lib/honeybadger/plugins/autotuner.rb
|
|
108
109
|
- lib/honeybadger/plugins/breadcrumbs.rb
|
|
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
|
|
@@ -208,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
208
210
|
- !ruby/object:Gem::Version
|
|
209
211
|
version: '0'
|
|
210
212
|
requirements: []
|
|
211
|
-
rubygems_version:
|
|
213
|
+
rubygems_version: 4.0.1
|
|
212
214
|
specification_version: 4
|
|
213
215
|
summary: Full-stack error tracking, performance monitoring, logging, and more.
|
|
214
216
|
test_files: []
|