Skip to content

Pr 5518#5542

Closed
mabdinur wants to merge 4 commits intomasterfrom
pr-5518
Closed

Pr 5518#5542
mabdinur wants to merge 4 commits intomasterfrom
pr-5518

Conversation

@mabdinur
Copy link
Copy Markdown
Contributor

@mabdinur mabdinur commented Apr 1, 2026

Shadow PR for: #5518

nhosoya and others added 2 commits March 27, 2026 16:07
Rails 8.1 inlined the body of `ActionDispatch::Journey::Router#find_routes`
directly into `recognize`, removing `find_routes` as a separate method.
The existing `LazyRouter` patch targets `find_routes`, so it silently had
no effect on Rails 8.1+, causing `http.route` to never be set on the
`rack.request` span.

Add a `RecognizeRouter` module that patches `recognize` instead, and
update the patcher's version gate to select it for ActionPack >= 8.1.

Two implementation details specific to Rails 8.1:
- Use delete_suffix instead of delete_suffix! as route.path.spec.to_s
  returns a frozen string.
- Capture SCRIPT_NAME before calling super, as recognize modifies
  req.script_name for mounted apps before yielding to the block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description.

If changes need to be present in CHANGELOG.md you can state it this way

**Change log entry**

Yes. A brief summary to be placed into the CHANGELOG.md

(possible answers Yes/Yep/Yeah)

Or you can opt out like that

**Change log entry**

None.

(possible answers No/Nope/None)

Visited at: 2026-04-01 17:55:53 UTC

@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Apr 1, 2026
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 bot commented Apr 1, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 41.67%
Overall Coverage: 95.35% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b382fac | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants