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
opentelemetry-goとGCPでパフォーマンス解析
Search
Yohei Iino
July 26, 2022
Technology
0
130
opentelemetry-goとGCPでパフォーマンス解析
opentelemetry-goとGCPでパフォーマンス解析
Yohei Iino
July 26, 2022
Tweet
Share
More Decks by Yohei Iino
See All by Yohei Iino
1年半放置したExpo製アプリを最新化してみた
wheatandcat
0
77
作成中のFlutterアプリの中間発表
wheatandcat
0
62
最近読んだ技術書を簡単紹介
wheatandcat
0
83
ユニバーサルリンク/アプリリンクを使ってQRコードでゲストログインできるようにする
wheatandcat
0
340
Firebase App Checkを実装したので紹介
wheatandcat
0
210
PlanetScaleの無料プランがなくなるので、NeonとTiDBを試してみた
wheatandcat
0
350
Flutter HooksとRiverpodの解説
wheatandcat
0
480
T3 Stack(応用編: Next Auth & SSRの実装紹介)
wheatandcat
1
370
App Routerの紹介
wheatandcat
0
120
Other Decks in Technology
See All in Technology
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
190
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
190
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
41k
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
110
Kubecon NA 2025: DRA 関連の Recap と社内 GPU 基盤での課題
kevin_namba
0
110
Databricks Free Edition講座 データサイエンス編
taka_aki
0
270
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
73k
AIとともに歩む情報セキュリティ / Information Security with AI
kanny
4
3.1k
AWS Devops Agent ~ 自動調査とSlack統合をやってみた! ~
kubomasataka
3
320
ゼロから始めたFindy初のモバイルアプリ開発
grandbig
2
630
エンジニアとマネジメントの距離/Engineering and Management
ikuodanaka
3
700
今日から始めるAmazon Bedrock AgentCore
har1101
4
320
Featured
See All Featured
Amusing Abliteration
ianozsvald
0
92
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
110
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
250
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
A Soul's Torment
seathinner
5
2.2k
Embracing the Ebb and Flow
colly
88
5k
Ruling the World: When Life Gets Gamed
codingconduct
0
130
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
59
42k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
52
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
220
Transcript
opentelemetry-go とGCP でパフォーマンス解析 Press Space for next page
自己紹介 📝 飯野陽平(wheatandcat ) 🏢 フリーランスエンジニア(シェアフル株式会社CTO ) 💻 Blog: https://www.wheatandcat.me/
🛠 今までに作ったもの memoir ペペロミア Atomic Design Check List
OpenTelemetry とは OpenTelemetry は、オープンソースのオブザーバビリティフレームワーク 運用しているアプリのパフォーマンスや健全性が正常な状態か判断するために使用する情報をテレメトリーデータ と呼ばれている テレメトリーデータは主に3 つのカテゴリに分類される ログ メトリクス
トレース OpenTelemetry は、それらのテレメトリデータを収集するためのベンダーに依存しないAPI 、ソフトウェア開発キッ ト(SDK) 、その他のツールを提供している Learn More 1 Learn More 2
opentelemetry-go リポジトリ: opentelemetry-go OpenTelemetry は、OpenCensus (+ Stackdriver )、OpenTracing のプロジェクトの正式な後継版 検索時に以下のリポジトリで実装されたものもヒットするが、これから実装するならopentelemetry-go
が推奨なの で注意 opencensus-go opentracing-go
対応のパッケージのサンプル OpenTelemetry のGitHub に言語ごとにリポジトリが作成されている https://github.com/open-telemetry?q=go&type=all&language=&sort= Go 言語なら以下を確認 opentelemetry-go-contrib Go のフレームワークなら以下を確認
https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/instrumentation/github.com
実装してみた① 実際にプロジェクトにopentelemetry-go を実装したみた。 構成は以下の通り プロジェクト: memoir-backend フレームワーク: gqlgen ベンダー: Cloud
Trace 最初はDatadog のAPM を想定していたが、Cloud Run For Manager をサポートしていなかったので😓、 Cloud Trace で実装
実装してみた② PR https://github.com/wheatandcat/memoir-backend/pull/128 以下を解説 gqlgen のトレースのハンドリングの解説 Cloud Trace の出力のデモ
Cloud Trace を実装してみての感想と課題 トレース情報が可視化されて、各 API の処理速度を直感的にわかるようになった 今回のプロジェクトはAPI の数も少ないのでトレース情報のみでも十分に解析可能だが、以下のようなケースでは別 のアプローチを考える必要がある トレース情報が大雑把すぎる。具体的に遅い処理を検知したい
API や処理数が膨大で漠然と全体的に遅い ユーザーによって処理が遅い 上記のケースではCloud Profiler が有効なので紹介
Cloud Profiler とは Cloud Profiler は、本番環境のアプリケーションからCPU 使用率やメモリ割り当てなどの情報を継続的に収集できる サービス トレースのような大雑把な情報は出力できないが、ピンポイントにボトルネックになっている処理の検知が行える 料金は無料なので、取り敢えず実装しておいても損は無さそう
Learn More
実装してみた 以下を参考に実装 https://cloud.google.com/profiler/docs/profiling-go?hl=ja 以下を解説 Cloud Profiler のデモ memoir-backend は処理がシンプル過ぎて、解説向きの情報が無いので以下で解説 以下を参考に実際の利用方法の解説
チュートリアル: Go アプリの最適化
おまけ 今回、実装までは行わなかったが、今回紹介したCloud Trace とCloud Profiler などの情報をまとめて、Cloud Monitoring でアラートもできそう https://cloud.google.com/architecture/integrating-monitoring-logging-trace-observability-and-alerting? hl=ja
Cloud Monitoring の説明は以下を参照 https://cloud.google.com/monitoring/monitor-compute-engine-virtual-machine
まとめ OpenTelemetry は現状デファクトなので、理解しておいたほうが良さそう パフォーマンス解析のアプローチについて理解できた 早くDatadog のAPM がCloud Run For Manager
をサポートして欲しい GKE 構成にすれば使えるけど、個人プロジェクトで、そこまで管理コストをかけたくない 😓
ご清聴ありがとうございました