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
opentelemetry-goとGCPでパフォーマンス解析
Search
Yohei Iino
July 26, 2022
Technology
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
opentelemetry-goとGCPでパフォーマンス解析
opentelemetry-goとGCPでパフォーマンス解析
Yohei Iino
July 26, 2022
More Decks by Yohei Iino
See All by Yohei Iino
1年半放置したExpo製アプリを最新化してみた
wheatandcat
0
120
作成中のFlutterアプリの中間発表
wheatandcat
0
98
最近読んだ技術書を簡単紹介
wheatandcat
0
120
ユニバーサルリンク/アプリリンクを使ってQRコードでゲストログインできるようにする
wheatandcat
0
400
Firebase App Checkを実装したので紹介
wheatandcat
0
370
PlanetScaleの無料プランがなくなるので、NeonとTiDBを試してみた
wheatandcat
0
440
Flutter HooksとRiverpodの解説
wheatandcat
0
610
T3 Stack(応用編: Next Auth & SSRの実装紹介)
wheatandcat
1
420
App Routerの紹介
wheatandcat
0
170
Other Decks in Technology
See All in Technology
AgentCoreで実践するハーネスエンジニアリング
yakumo
1
290
Incremental HTTP
kazuho
5
2.1k
Snowflake Horizon Catalog と Apache Iceberg で作る オープンなデータ基盤
kitagawaz
0
460
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
120
予測不能な実行エージェントを安全にサクッと試せるサンドボックス環境の話
sansantech
PRO
0
130
AI 時代の Azure エンジニアリング ~ 私たちは何を磨き、何を任せるのか ~
chack411
1
530
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
600
全人類(ほぼ)AWS Organizations の上でAWSを利用している、その世界を知る話
htan
1
120
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
140
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
Codex概要
ymiya55
0
470
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Optimising Largest Contentful Paint
csswizardry
37
4k
Are puppies a ranking factor?
jonoalderson
2
4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Docker and Python
trallard
47
4.2k
Scaling GitHub
holman
464
140k
Paper Plane
katiecoart
PRO
4
54k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
300
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
530
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
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 構成にすれば使えるけど、個人プロジェクトで、そこまで管理コストをかけたくない 😓
ご清聴ありがとうございました