Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Flight recorder at the application layer (NOT t...
Search
Ken’ichiro Oyama
August 25, 2025
Technology
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Flight recorder at the application layer (NOT the FlightRecoder newly added at Go 1.25) / Fukuoka.go #22
https://fukuokago.connpass.com/event/364970/
Ken’ichiro Oyama
August 25, 2025
More Decks by Ken’ichiro Oyama
See All by Ken’ichiro Oyama
Introducing RFC9111 / YAPC::Fukuoka 2025
k1low
2
5.7k
Design and implementation of "Markdown to Google Slides" / phpconfuk 2025
k1low
1
1.1k
analysis パッケージの仕組みの上でMulti linter with configを実現する / Go Conference 2025
k1low
1
890
ソフトウェア開発におけるインターフェイスという考え方 / PHPerKaigi 2025
k1low
12
6.4k
Parsing HCL/CUE / Fukuoka.go #21
k1low
0
11k
実践 net/http Middleware パターン / Kizuku.go Vol.1
k1low
2
470
Cleanup handling in Go / Go Conference 2024
k1low
7
4.2k
CI/CDがあたりまえの今の時代にAPIテスティングツールに求められていること / CI/CD Test Night #7
k1low
18
12k
Command-line interface tool design / PHPerKaigi 2024
k1low
8
4k
Other Decks in Technology
See All in Technology
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
140
幾何アルゴリズムで なめらかなピン操作を / iOSDC Japan 2026 / smoothpin
kazumanagano
0
350
バイブコーディング時代のWebアプリ開発入門~Cloud Runで学ぶセキュアなビルドとデプロイ
waiwai2111
1
120
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
3
550
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
470
2026-09-11 【Snowflake World Tour Tokyo 2026】Snowflakeを起点に、AI Agentが自律稼働し続ける未来へ / Driving AI Agents with Snowflake
civitaspo
0
400
Deploying a Full-Stack Bun-Native Framework on Cloudflare Workers
7nohe
0
170
Genieを崇めよ
kameitomohiro
0
120
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
8
920
MCPをつなげて作る組織横断のAIエージェント基盤(の開発工程)
tsubakimoto_s
0
130
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
190
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
1
520
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Evolving SEO for Evolving Search Engines
ryanjones
0
290
Building the Perfect Custom Keyboard
takai
2
870
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
850
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Building Applications with DynamoDB
mza
96
7.2k
KATA
mclloyd
PRO
35
15k
The Pragmatic Product Professional
lauravandoore
37
7.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
940
Transcript
Flight recorder at the application layer (NOT the FlightRecoder newly
added at Go 1.25) ⼩⼭健⼀郎 / Tailor Inc. 2025.8.25 Fukuoka.go #22
• Go 1.25で runtime/trace 追加された機能 ◦ https://pkg.go.dev/runtime/trace#FlightRecorder • トレースデータのサイズや継続的な書き込みコストから従来の実⾏トレースキャプチャでは実⽤的でな かった稀なイベントのデバッグに役にたつ軽量な実⾏トレースキャプチャ。
• 仕組みとしては実⾏トレースをインメモリのリングバッファに継続的に記録し、重要なイベントが発⽣し た際に、FlightRecorder.WriteTo を呼び出すことで、直近のトレースをファイルに書き出す。 • 直前の、必要なトレースのみをキャプチャできるため、⽣成されるトレースが⼤幅に⼩さくなる。 ◦ 従来の実⾏トレースのように⾼コストではないため、常に有効にしやすい。 • FlightRecorderConfig 内で、キャプチャする期間やデータ量を設定できる runtime/trace.FlightRecorder 2
• goroutine creation/blocking/unblocking (Goroutineの作成/ブロック/ブロック解除) • syscall enter/exit/block (System callの⼊⼒/終了/ブロック) •
GC-related events (GC 関連イベント) • changes of heap size (ヒープサイズの変更) • processor start/stop (プロセッサの開始/停⽌) • etc. runtime/trace で取得できるトレースデータ 3
• エラーが発⽣したときに原因を特定したい • コードのどこでエラーになったのか • エラーになるまでにどのような処理をしていたのか • (OSSのCLIツールとして提供しているのでOtelは使いにくい) つまり、スタックトレースや実⾏ログが欲しい アプリケーションレイヤで欲しいトレースデータ
4
• エラー時にスタックトレースと直前のログをまとめてファイルに書き出す ◦ 全てのログは必要ない。 https://pkg.go.dev/runtime/trace#FlightRecorder と同じ • ログは LogLevel=Debug な詳細なログが欲しい
アプリケーションレイヤのFlight recorder 5
スタックトレース 6
• https://github.com/k1LoW/errors • errors + stack staces. • 実装コンセプトは ◦
Retain the stack traces once stacked as far as possible. ▪ Support for errors.Join. ◦ It is possible to output stack traces in structured data. ◦ Zero dependency k1LoW/errors 7
直前のデバッグログ 8
• ユーザがログレベルをハンドリングするログハンドラと、Flight recorder⽤のログハンドラの2つに分ける ◦ Flight recorder⽤のログは常に LogLevel=Debug • log/slog だと
https://github.com/samber/slog-multi を使うと良い まずログを分岐する 9
• https://github.com/k1LoW/tail • 直近N⾏だけを保持する io.Writer を満たす実装 k1LoW/tail 10
11 完成
12
少し実⽤的で⼩さなOSSを書くのが趣味 • GitHub: @k1LoW • X: @k1LoW • SWE at
Tailor Inc. ⾃⼰紹介 13 Ken'ichiro Oyama ⼩⼭健⼀郎
14 わたしたちは、"Empower every company to deploy any ideas (誰もがデプロイできる社会を創る)" というミッ
ションのもと、誰しもがプロダクト開発の担い⼿になることができる社会の実現を⽬指しています。ミッション の実現に向けて、共に挑戦する仲間を募集しています。 https://careers.tailor.tech/ 共に働く仲間を募集しています