honeybadger 6.9.2 → 6.9.3
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 +7 -0
- data/lib/honeybadger/agent.rb +6 -1
- data/lib/honeybadger/init/rails.rb +8 -1
- data/lib/honeybadger/rack/request_id.rb +27 -0
- data/lib/honeybadger/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fe7e1dc021b03b75e886083cda940bd73ac4613427229e0b9a08c4e65badf548
|
|
4
|
+
data.tar.gz: ea2e996262898454537f1e65e394d4d1cd93226420dab1d0d66ad8b408cac200
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ae65e4be79d6ed5761b54139488681f1d5a591f8a5f1b44185e17d4322120f2a280055704a1a56e5e0836bb12f2dcf2c91372f9e0c0c9b06a488e69089fd7ce
|
|
7
|
+
data.tar.gz: 8ac9bb344ab71c34de08a8eefb3bb7dc2393d7c29d6f59f6cbe289d6c428a699cc679d599088d2d6c87f8e1a6de9069cc079f156b272385299e25b2e81361002
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## [6.9.3](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.9.2...v6.9.3) (2026-09-29)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* propagate the Rails request ID to notices and Insights events ([#848](https://github.com/honeybadger-io/honeybadger-ruby/issues/848)) ([23edb08](https://github.com/honeybadger-io/honeybadger-ruby/commit/23edb08f4fda3b3f66fb697c5ec5502f39aeb127))
|
|
10
|
+
|
|
4
11
|
## [6.9.2](https://github.com/honeybadger-io/honeybadger-ruby/compare/v6.9.1...v6.9.2) (2026-09-15)
|
|
5
12
|
|
|
6
13
|
|
data/lib/honeybadger/agent.rb
CHANGED
|
@@ -579,13 +579,18 @@ module Honeybadger
|
|
|
579
579
|
# @api private
|
|
580
580
|
def with_rack_env(rack_env, &block)
|
|
581
581
|
context_manager.set_rack_env(rack_env)
|
|
582
|
-
context_manager.set_request_id(
|
|
582
|
+
context_manager.set_request_id(SecureRandom.uuid)
|
|
583
583
|
yield
|
|
584
584
|
ensure
|
|
585
585
|
context_manager.set_rack_env(nil)
|
|
586
586
|
context_manager.set_request_id(nil)
|
|
587
587
|
end
|
|
588
588
|
|
|
589
|
+
# @api private
|
|
590
|
+
def set_request_id(request_id)
|
|
591
|
+
context_manager.set_request_id(request_id)
|
|
592
|
+
end
|
|
593
|
+
|
|
589
594
|
# @api private
|
|
590
595
|
attr_reader :worker, :events_worker, :metrics_worker
|
|
591
596
|
|
|
@@ -2,6 +2,7 @@ require "rails"
|
|
|
2
2
|
require "yaml"
|
|
3
3
|
|
|
4
4
|
require "honeybadger/ruby"
|
|
5
|
+
require "honeybadger/rack/request_id"
|
|
5
6
|
|
|
6
7
|
module Honeybadger
|
|
7
8
|
module Init
|
|
@@ -14,8 +15,14 @@ module Honeybadger
|
|
|
14
15
|
initializer "honeybadger.install_middleware" do |app|
|
|
15
16
|
honeybadger_config = Honeybadger::Agent.instance.config
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
# ErrorNotifier also sets up the request context that Insights events
|
|
19
|
+
# read. Agent#notify does nothing when exceptions are disabled.
|
|
20
|
+
if honeybadger_config[:"exceptions.enabled"] || honeybadger_config[:"insights.enabled"]
|
|
18
21
|
app.config.middleware.insert(0, Honeybadger::Rack::ErrorNotifier)
|
|
22
|
+
app.config.middleware.insert_after(::ActionDispatch::RequestId, Honeybadger::Rack::RequestId)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
if honeybadger_config[:"exceptions.enabled"]
|
|
19
26
|
app.config.middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserInformer) if honeybadger_config[:"user_informer.enabled"]
|
|
20
27
|
app.config.middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserFeedback) if honeybadger_config[:"feedback.enabled"]
|
|
21
28
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require "honeybadger/ruby"
|
|
2
|
+
|
|
3
|
+
module Honeybadger
|
|
4
|
+
module Rack
|
|
5
|
+
# @api private
|
|
6
|
+
#
|
|
7
|
+
# Copies the request ID assigned by ActionDispatch::RequestId into the
|
|
8
|
+
# Honeybadger context. Must sit after ActionDispatch::RequestId in the
|
|
9
|
+
# middleware stack.
|
|
10
|
+
#
|
|
11
|
+
# No ensure/cleanup here: ErrorNotifier owns the request lifecycle and
|
|
12
|
+
# clears state after the stack unwinds. Clearing here would nil the ID
|
|
13
|
+
# before ErrorNotifier builds the notice on exception.
|
|
14
|
+
class RequestId
|
|
15
|
+
def initialize(app, agent = nil)
|
|
16
|
+
@app = app
|
|
17
|
+
@agent = agent if agent.is_a?(Agent)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def call(env)
|
|
21
|
+
request_id = env["action_dispatch.request_id"]
|
|
22
|
+
(@agent || Honeybadger::Agent.instance).set_request_id(request_id) if request_id
|
|
23
|
+
@app.call(env)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
data/lib/honeybadger/version.rb
CHANGED
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.9.
|
|
4
|
+
version: 6.9.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Honeybadger Industries LLC
|
|
@@ -131,6 +131,7 @@ files:
|
|
|
131
131
|
- lib/honeybadger/plugins/thor.rb
|
|
132
132
|
- lib/honeybadger/plugins/warden.rb
|
|
133
133
|
- lib/honeybadger/rack/error_notifier.rb
|
|
134
|
+
- lib/honeybadger/rack/request_id.rb
|
|
134
135
|
- lib/honeybadger/rack/user_feedback.rb
|
|
135
136
|
- lib/honeybadger/rack/user_informer.rb
|
|
136
137
|
- lib/honeybadger/registry.rb
|