Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
20251016_Rails News ~Rails 8.1の足音を聴く~
Search
Masato Mori
October 15, 2025
Programming
3
900
20251016_Rails News ~Rails 8.1の足音を聴く~
2025/10/16に開催した RailsTokyo #1 で発表した資料です。
https://railstokyo.connpass.com/event/363339/
Masato Mori
October 15, 2025
Tweet
Share
More Decks by Masato Mori
See All by Masato Mori
20220218_Rails開発プロジェクトチームの始め方と入り方 in 銀座Rails#42
morimorihoge
3
580
20220125_令和版!RailsアプリでPDF生成するテクニック集 in 銀座Rails#41
morimorihoge
8
6.8k
それVIEWでできるよ!(Kaigi on Rails _2021_ new LT)
morimorihoge
2
160
20210827_出張!Railsウォッチ in 銀座Rails#36
morimorihoge
0
1.9k
20210730_出張!Railsウォッチ in 銀座Rails#35
morimorihoge
0
1.8k
20210618_出張!Railsウォッチ in 銀座Rails#34
morimorihoge
0
2.2k
20210521_出張!Railsウォッチ in 銀座Rails#33
morimorihoge
1
6.9k
20210423_出張!Railsウォッチ in 銀座Rails#32
morimorihoge
0
40
20210226_出張!Railsウォッチ in 銀座Rails#30
morimorihoge
0
490
Other Decks in Programming
See All in Programming
Inside of Swift Export
giginet
PRO
1
270
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
450
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
9.3k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
690
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
200
GC25 Recap: The Code You Reviewed is Not the Code You Built / #newt_gophercon_tour
mazrean
0
140
ノーコードからの脱出 -地獄のデスロード- / Escape from Base44
keisuke69
0
110
オンデバイスAIとXcode
ryodeveloper
0
370
Introducing RemoteCompose: break your UI out of the app sandbox.
camaelon
2
300
Software Architecture
hschwentner
6
2.4k
GitHub Copilotを使いこなせ!/mastering_github_copilot!
kotakageyama
2
590
社会人になっても趣味開発を続けたい! / traPavilion
mazrean
1
120
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
9.1k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Designing for Performance
lara
610
69k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Building Adaptive Systems
keathley
44
2.8k
Building an army of robots
kneath
306
46k
Designing for humans not robots
tammielis
254
26k
4 Signs Your Business is Dying
shpigford
186
22k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Being A Developer After 40
akosma
91
590k
Transcript
Rails News ~Rails 8.1の足音を聴く~ ~Structured Event Reporting解説~ ver. RailsTokyo #1
2025/10/16 森 雅智 / @morimorihoge 2025/10/16
• Web受託開発や自社サービス開発・運営をやっている会社です • TechRachoという自社技術Blogを運営しています ◦ 10年ほど前から平日毎日更新 してます ◦
https://techracho.bpsinc.jp/ • お仕事相談、転職相談、TechRachoへのご意見など気軽にどうぞ ◦ https://www.bpsinc.jp/ About Me • 森 雅智: @morimorihoge • BPS株式会社でRailsの受託開発チームをやってたり、週1大学非常勤でWeb開発を教えてたり します • Ruby/Rails歴は15年くらい。Web開発は20年くらい • 主にリモート開催時代に力尽きるまで銀座Railsを運営していました 🙏💦 • RailsTokyoではチームの力でやっていけるように強力していきます 💪 About BPS & TechRacho
About TechRacho 毎日更新の技術ブログです。Railsネタ多めなのでぜひBookmark & 購読してください😎
Rails 8.1の足音を聴く
【NEW】2025/10/15: Rails 8.1.0.rc1 リリース!
Rails 8.1の新機能(抜粋) • Active Job Continuations ◦ 大きなJobをstepごとに記述しておく ことで、一時停止・再開可能 に
• Active Record Tenanting: Codeminerの詳しいやってみた記事 ◦ テナントごとにDBを分ける 機能。現状SQLite3環境のみサポート • Action Push Native ◦ iOS/Android環境にAPNs / FCMを使ってpush通知する機能 • Lexxy (early beta): ※ちょっとデモする ◦ Action Textで現在のTrixを将来置き換えていく予定のよりリッチな WYSIWYGエディタ。PDFや動画 のプレビュー対応・”/” “@” によるイマドキのprompt / mention入力アシストなどもできるらしい • Structured Event Reporting ◦ -> 本日pickupして解説します • その他 ◦ Local CI、Markdown Rendering、Kamalの改善など 参考: https://rubyonrails.org/2025/9/4/rails-8-1-beta-1 https://blog.codeminer42.com/whats-new-in-rails-8-1-and-its-ecosystem など
Structured Event Reporting • 構造化したアプリケーションイベントをPub / Subする仕組み • Rails.eventを通じて利用することができる ◦
Event Reporterと呼ばれている機能 • ビジネスロジック的に取りたいイベントや、特定の問題調査などに利用できる • アプリケーションイベントの例 ◦ 商品を購入した ◦ 商品を閲覧した ◦ ユーザーがN日ぶりにログインした ◦ 商品のお気に入り登録数が 100を超えた
🤔ActiveSupport::Notificationsと何が違うの? • 以前からあるAS::NotificationsもPub/Subの仕組みを持っている • 今までも以下のような形でアプリケーションイベントを取ることはできた
Structured Event Reporting版
Structured Event Reporting版 Subscriber登録型に contextやtagを柔軟に設定可能に
AS::Notificationsに対する機能上の優位点 • pub / subするchannelの指定が柔軟 ◦ AS::Notificationsは文字列でしか指定できない : “sql.active_record” “enqueue_at.active_job”
◦ Structured Event Reportingはtags / contextの仕組みがあり、より柔軟な仕様が用意されている • tags / contextの指定方法が柔軟 ◦ AS::Notificationsは #instrument 呼び出し時にpayload内をすべて構築する必要がある ◦ Structured Event Reporting は #set_context でglobalな値を設定できたり、 #tagged を使ってブ ロック内でのみ当該tagを効かせるということができる ▪ before_actionやmiddlewareでcontextを設定できる
おそらくこんな使い方が想定されているのだろう(私見) • AS::Notifications ◦ これまでもログとして出力されているような Railsのシステム的な処理を扱う ◦ アプリケーションエラーや Jobの投入・実行状況などを扱う •
Structured Event Reporting ◦ よりビジネスレイヤや運用者視点でのイベントを扱う ◦ アプリケーションログとは別の LogStreamとしてCloudWatch Logsに流し、JSONログとして解析す るとか ◦ OpenTelemetryやDatadogにメトリクスを送信し、いい感じの Dashboardを作って閲覧するとか
その他気づいたこと • Loggingの置き換えではないので、JSON Logを出力したいという場合はJSON Loggerなどと組み合わせる必要がある ◦ JSONSubscriberなどを作ってsubscribeさせるイメージ • Subscriberの呼び出しは同期処理なので、重い処理を書くとレスポンス速度に影 響が出る
◦ AS::Notificationsと同じ。どうしても時間のかかる処理がしたければ Subscriber#emit 内で新しい スレッドを立てるなり、 Jobに詰むなりが必要 • tags / contextは柔軟な実装ができるが、収集・分析する側の問題もあるのでデー タ設計は慎重に ◦ contextのデータ構造を変えたら過去のデータと互換性がなくなってしまうので注意
まとめ • Rails 8.1のリリースが秒読みに入ったので、まだの人はそろそろキャッチアップ を! • 感想・リクエストなどあればXにて #railstokyo_meetup や @morimorihoge
までお 声かけください