Skip to content

fix(rails): Track request queue time in Rails middleware#2877

Merged
dingsdax merged 1 commit intomasterfrom
fix/rails-queue-time-2873
Mar 2, 2026
Merged

fix(rails): Track request queue time in Rails middleware#2877
dingsdax merged 1 commit intomasterfrom
fix/rails-queue-time-2873

Conversation

@dingsdax
Copy link
Contributor

@dingsdax dingsdax commented Mar 2, 2026

The Rails CaptureExceptions middleware subclass overrode start_transaction without calling super, so the http.server.request.time_in_queue attachment added in #2838 was silently skipped for all Rails apps.

Extract queue time attachment into a private attach_queue_time method on the Rack base class so the Rails subclass can invoke it explicitly while keeping its own options hash (preserving the correct SPAN_ORIGIN constant "auto.http.rails" via lexical scoping).

Fixes #2873

@dingsdax dingsdax requested review from sl0thentr0py and solnic and removed request for sl0thentr0py March 2, 2026 08:51
The Rails CaptureExceptions middleware subclass overrode start_transaction
without calling super, so the http.server.request.time_in_queue attachment
added in #2838 was silently skipped for all Rails apps.

Extract queue time attachment into a private attach_queue_time method on
the Rack base class so the Rails subclass can invoke it explicitly while
keeping its own options hash (preserving the correct SPAN_ORIGIN constant
"auto.http.rails" via lexical scoping).

Fixes #2873
Co-Authored-By: Claude <noreply@anthropic.com>
@dingsdax dingsdax force-pushed the fix/rails-queue-time-2873 branch from a57883c to 3061645 Compare March 2, 2026 09:04
@dingsdax dingsdax requested a review from sl0thentr0py March 2, 2026 09:11
@dingsdax dingsdax merged commit 66c2ad1 into master Mar 2, 2026
134 checks passed
@dingsdax dingsdax deleted the fix/rails-queue-time-2873 branch March 2, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request queue time not tracked in rails

2 participants