Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## [Unreleased]

## [1.20.1] - 2026-02-10

### Fixed

- Ensure configuration is built correctly inside the `after_initialize` hooks (#208).

## [1.20.0] - 2026-01-20

### Added
Expand Down
1 change: 1 addition & 0 deletions lib/rage/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def internal
# @private
def run_after_initialize!
run_hooks_for!(:after_initialize, self)
__finalize
end

class LogContext
Expand Down
2 changes: 1 addition & 1 deletion lib/rage/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Rage
VERSION = "1.20.0"
VERSION = "1.20.1"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class TestControllerObserver < Rage::Telemetry::Handler
handle "controller.action.process", with: :monitor_controllers

def self.monitor_controllers(name:)
Rage.logger.tagged(name) do
yield
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class TestExceptionRecorder < Rage::Telemetry::Handler
handle "controller.action.process", with: :record_exceptions

def self.record_exceptions
result = yield
Rage.logger.error("telemetry recorded exception #{result.exception.message}") if result.error?
end
end
25 changes: 4 additions & 21 deletions spec/integration/test_app/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,6 @@ def call(env)
end
end

class TestControllerObserver < Rage::Telemetry::Handler
handle "controller.action.process", with: :monitor_controllers

def self.monitor_controllers(name:)
Rage.logger.tagged(name) do
yield
end
end
end

class TestExceptionRecorder < Rage::Telemetry::Handler
handle "controller.action.process", with: :record_exceptions

def self.record_exceptions
result = yield
Rage.logger.error("telemetry recorded exception #{result.exception.message}") if result.error?
end
end

Rage.configure do
config.middleware.use TestMiddleware
config.public_file_server.enabled = !!ENV["ENABLE_FILE_SERVER"]
Expand Down Expand Up @@ -66,8 +47,10 @@ def self.record_exceptions
end

if ENV["ENABLE_TELEMETRY"]
config.telemetry.use TestControllerObserver
config.telemetry.use TestExceptionRecorder
config.after_initialize do
config.telemetry.use TestControllerObserver
config.telemetry.use TestExceptionRecorder
end
end

config.after_initialize do
Expand Down
Loading