honeybadger 6.7.0 → 6.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afa4582b4bb18d1f9afc94a2c551ceb45643ef57be27e071f4878970bde4dfdb
4
- data.tar.gz: e80f53bbd49fd9db0d0334b5fceb9d0153a4e78272fb460209e6741300299e0d
3
+ metadata.gz: c0df809e34f5f0cbd3e4d63c411f215dc2f9418b8909a7aedb9a5fb6c454afbe
4
+ data.tar.gz: e811145ad02eef49a8078d3cb827ad47cdf35693a986a55e12bf2a6108f1b052
5
5
  SHA512:
6
- metadata.gz: d4086244d6d9857f5a49be22a889ca5b3b9bb789bc9015ff08732810428930e03d9b0e4b56149f670c3b1e5321497d795c5af9f21290630b80ed83c117aaa71d
7
- data.tar.gz: f81135eefd9c61f33f27666e3e7ea7c94537dddaa19cc5e770765505f322ad62bf2096469a7abc2395bb1f0e78a9ea43309592c3580aae47e158299178cf6dd1
6
+ metadata.gz: e4470a6b43117aad7db8069fe87287fc8486c9b02a79ebf43184228251fb81eeb3549b7458593f0ee0ce0e9784b85790b2ad3b97bc01c0cf46d98f49bafd2699
7
+ data.tar.gz: 2aefdc40100c38c1707642be6ab04d0a72248b09734ef8f681e06753f3945854fbcc07f2e89f71ee3477fca1177e273899bb470983cabeb62b080ebafd0f04be
data/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log
2
2
 
3
3
 
4
+ ## [6.9.0](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.8.0...v6.9.0) (2026-06-11)
5
+
6
+
7
+ ### Features
8
+
9
+ * make RubyLLM insights subscriber configurable ([#829](https://github.com/honeybadger-io/honeybadger-ruby/issues/829)) ([fc9ff42](https://github.com/honeybadger-io/honeybadger-ruby/commit/fc9ff42689b87f972183286d34c7e4059bf23442))
10
+
11
+ ## [6.8.0](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.7.0...v6.8.0) (2026-06-10)
12
+
13
+
14
+ ### Features
15
+
16
+ * add RubyLLM monitoring plugin ([#827](https://github.com/honeybadger-io/honeybadger-ruby/issues/827)) ([4b2c32d](https://github.com/honeybadger-io/honeybadger-ruby/commit/4b2c32d933b1dd35599b2a292027d50458f2c384))
17
+
4
18
  ## [6.7.0](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.6.2...v6.7.0) (2026-06-05)
5
19
 
6
20
 
@@ -156,7 +156,7 @@ module Honeybadger
156
156
  end
157
157
 
158
158
  def to_s
159
- lines.map(&:to_s).join("\n")
159
+ lines.join("\n")
160
160
  end
161
161
 
162
162
  def inspect
@@ -574,6 +574,16 @@ module Honeybadger
574
574
  description: "Enable automatic data collection for Flipper.",
575
575
  default: true,
576
576
  type: Boolean
577
+ },
578
+ "ruby_llm.insights.enabled": {
579
+ description: "Enable automatic data collection for RubyLLM.",
580
+ default: true,
581
+ type: Boolean
582
+ },
583
+ "ruby_llm.insights.subscriber": {
584
+ description: "Fully qualified class name of a custom subscriber for RubyLLM instrumentation. A class constant may also be given via Ruby configuration. Defaults to Honeybadger::RubyLLMSubscriber.",
585
+ default: nil,
586
+ type: String
577
587
  }
578
588
  }.freeze
579
589
 
@@ -0,0 +1,69 @@
1
+ require "honeybadger/plugin"
2
+ require "honeybadger/notification_subscriber"
3
+
4
+ module Honeybadger
5
+ module Plugins
6
+ module RubyLLM
7
+ Plugin.register :ruby_llm do
8
+ requirement { defined?(::RubyLLM) }
9
+ requirement { defined?(::ActiveSupport::Notifications) }
10
+
11
+ execution do
12
+ if config.load_plugin_insights?(:ruby_llm)
13
+ class_name = config[:"ruby_llm.insights.subscriber"].to_s.strip
14
+ subscriber = if class_name.empty?
15
+ Honeybadger::RubyLLMSubscriber.new
16
+ else
17
+ begin
18
+ candidate = Object.const_get(class_name).new
19
+ unless candidate.respond_to?(:start) && candidate.respond_to?(:finish)
20
+ raise TypeError, "does not respond to #start and #finish"
21
+ end
22
+ candidate
23
+ rescue => e
24
+ logger.error("Unable to load ruby_llm.insights.subscriber=#{class_name} (#{e.class}: #{e.message}); falling back to Honeybadger::RubyLLMSubscriber")
25
+ Honeybadger::RubyLLMSubscriber.new
26
+ end
27
+ end
28
+
29
+ # request.ruby_llm is intentionally excluded: it fires for every
30
+ # provider HTTP request (including retries and streams) and
31
+ # duplicates chat-level metadata.
32
+ ::ActiveSupport::Notifications.subscribe(
33
+ /(chat|tool_call|embedding|image|moderation|transcription|models\.refresh)\.ruby_llm/,
34
+ subscriber
35
+ )
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ module Honeybadger
44
+ class RubyLLMSubscriber < NotificationSubscriber
45
+ # Payloads carry full Ruby objects (chat, messages, responses, tool
46
+ # arguments, inputs), which may contain sensitive content. Allow only
47
+ # scalar metadata through.
48
+ def format_payload(name, payload)
49
+ case name
50
+ when "chat.ruby_llm"
51
+ payload.slice(:provider, :provider_class, :model, :message_count, :temperature, :tool_choice, :tool_call_limit, :streaming, :response_model, :response_role, :tool_call, :input_tokens, :output_tokens, :cached_tokens, :cache_creation_tokens, :thinking_tokens, :exception)
52
+ when "tool_call.ruby_llm"
53
+ payload.slice(:provider, :provider_class, :model, :tool_name, :tool_call_id, :result_class, :exception)
54
+ when "embedding.ruby_llm"
55
+ payload.slice(:provider, :provider_class, :model, :dimensions, :response_model, :input_tokens, :embedding_dimensions, :embedding_count, :exception)
56
+ when "image.ruby_llm"
57
+ payload.slice(:provider, :provider_class, :model, :size, :response_model, :exception)
58
+ when "moderation.ruby_llm"
59
+ payload.slice(:provider, :provider_class, :model, :flagged, :exception)
60
+ when "transcription.ruby_llm"
61
+ payload.slice(:provider, :provider_class, :model, :language, :response_model, :input_tokens, :output_tokens, :exception)
62
+ when "models.refresh.ruby_llm"
63
+ payload.slice(:remote_only, :model_count, :exception)
64
+ else
65
+ payload.slice(:provider, :provider_class, :model, :exception)
66
+ end
67
+ end
68
+ end
69
+ end
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # The current String Honeybadger version.
3
- VERSION = "6.7.0".freeze
3
+ VERSION = "6.9.0".freeze
4
4
  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.7.0
4
+ version: 6.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
@@ -122,6 +122,7 @@ files:
122
122
  - lib/honeybadger/plugins/passenger.rb
123
123
  - lib/honeybadger/plugins/rails.rb
124
124
  - lib/honeybadger/plugins/resque.rb
125
+ - lib/honeybadger/plugins/ruby_llm.rb
125
126
  - lib/honeybadger/plugins/shoryuken.rb
126
127
  - lib/honeybadger/plugins/sidekiq.rb
127
128
  - lib/honeybadger/plugins/solid_queue.rb