koderift-rails 2.1.1 → 2.1.2

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: 41b72b93e0b7252313779b2cdaab30897ae9929b00e12fcc2b7d4f308fa655df
4
- data.tar.gz: 5e25c8a220e8aba44ea3f9a623da6f646e3e7564e1c4a44be6583549a51c4156
3
+ metadata.gz: 9e0939c31d9ed90e327052741d51a200a559c6723a06a282cc9df8c44c3585e9
4
+ data.tar.gz: 78ec3fd6c4cb9202fd51ca6443ef2c777e222bb1fd3bf543187a03c7341945ea
5
5
  SHA512:
6
- metadata.gz: 488980d844b621356cd3b2b13519f763f8d66970cb1c5be3ee95127b61a80cbb6cade2f601682146d7d090d3bcfc89447f67eb57de375595c00fc3a9ff029d8c
7
- data.tar.gz: bbc7c57849bf2f59a1b47b2568afd990ce64c5f210f41423d5a50a5a274a25ef119ed014841529c13e39ce9c4701f09bc714cfebd58d13caeb5557f7a1a4b38e
6
+ metadata.gz: 02e615e243fecb096cb7b81246b52eb0915ff983f7d35e4b741979e1008136746c51e15e01042f4f4b9728a4980c4d2c87774f555d19b97873ac6a4dfe7b3327
7
+ data.tar.gz: 81f126d9398acba954df8fa2260c2ce3a3dadc013139d8cee0d07958f9151b553b5da3a76549b1e60d2e0145cd2669d0d59d039a1db3bc6d2c5339114a84bea0
data/CHANGELOG.md CHANGED
@@ -6,6 +6,32 @@ This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
  Releases before 1.3.4 were installed from git and were never published to
7
7
  RubyGems; they are listed for continuity.
8
8
 
9
+ ## [2.1.2] - 2026-11-19
10
+
11
+ Fixes missing request detail for controllers that inherit from
12
+ `ActionController::API`.
13
+
14
+ ### Fixed
15
+ - Controllers that inherit from `ActionController::API` are now instrumented,
16
+ not just those that inherit from `ActionController::Base`. That covers every
17
+ controller in an API-only app, and API namespaces in a normal app.
18
+ `ActionController::API` is a separate base class, not a subclass of
19
+ `ActionController::Base`, so before this fix their requests were never
20
+ instrumented. Lograge still logged each request with its duration, DB and
21
+ view time and status. But the line had no SQL, partial, search or HTTP
22
+ spans, no breadcrumbs, params, user, IP, user agent or trace ID. In Koderift
23
+ their traces showed the whole request as Ruby time with nothing to explain
24
+ it.
25
+
26
+ ### Notes
27
+ - Requests logged before you upgrade keep the missing detail. It was never
28
+ collected.
29
+ - If your API base controller fills Koderift's fields itself, through
30
+ `append_info_to_payload` or by including `Koderift::Rails::Controller`, you
31
+ can remove that after upgrading. Leaving it in does no harm. The concern runs
32
+ once per request, and an override that calls `super` gets the gem's fields
33
+ first.
34
+
9
35
  ## [2.1.1] - 2026-11-12
10
36
 
11
37
  Fixes missing request data in apps where another gem defines `Object#logger`.
data/README.md CHANGED
@@ -3,7 +3,9 @@
3
3
  Rails instrumentation gem for [Koderift](https://koderift.com) log analytics.
4
4
 
5
5
  Automatically captures request context, performance data, and error
6
- information — no manual `ApplicationController` changes needed.
6
+ information — no manual `ApplicationController` changes needed. Controllers
7
+ that inherit from `ActionController::Base` and from `ActionController::API`
8
+ are both covered (the second needs 2.1.2 or newer).
7
9
 
8
10
  ## Installation
9
11
 
@@ -22,14 +22,27 @@ module Koderift
22
22
  end
23
23
  end
24
24
 
25
- # Include the controller concern into ActionController::Base
25
+ # ActionController::API is a second base class, not a subclass of
26
+ # ActionController::Base. Hooking only Base left every API controller --
27
+ # all of an API-only app, or an app's JSON API namespace -- without the
28
+ # around_action: lograge still wrote the request line, but with no spans,
29
+ # breadcrumbs, params, trace ID or user, so its trace showed the whole
30
+ # request as unexplained Ruby time.
31
+ CONTROLLER_LOAD_HOOKS = %i[action_controller_base action_controller_api].freeze
32
+
33
+ def self.include_controller_concern
34
+ CONTROLLER_LOAD_HOOKS.each do |hook|
35
+ ActiveSupport.on_load(hook) do
36
+ require 'koderift/rails/controller'
37
+ include Koderift::Rails::Controller
38
+ end
39
+ end
40
+ end
41
+
26
42
  initializer 'koderift.include_controller', after: :load_config_initializers do
27
43
  next unless Koderift::Rails.configuration.enabled
28
44
 
29
- ActiveSupport.on_load(:action_controller_base) do
30
- require 'koderift/rails/controller'
31
- include Koderift::Rails::Controller
32
- end
45
+ Koderift::Rails::Railtie.include_controller_concern
33
46
  end
34
47
 
35
48
  # Make koderift_rum_meta_tag available in all views
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Koderift
4
4
  module Rails
5
- VERSION = '2.1.1'
5
+ VERSION = '2.1.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koderift-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koderift