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で分散型アプリケーション の処理フローを可視化する
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Hank Ehly
September 05, 2022
Technology
1.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
OpenTelemetryで分散型アプリケーション の処理フローを可視化する
Hank Ehly
September 05, 2022
More Decks by Hank Ehly
See All by Hank Ehly
Fivetranでデータ移動を自動化する
hankehly
0
680
Celeryの紹介と本番運用のTips
hankehly
0
1.7k
ChatGPTを活用した 便利ツールの紹介
hankehly
1
1.4k
Efficient Energy Analytics with Airflow, Spark, and MLFlow
hankehly
0
440
Deferrable Operators入門
hankehly
0
810
【初心者/ハンズオン】Dockerコンテナの基礎知識
hankehly
0
620
Compositeパターン: オブジェクトの階層関係をエレガントに表現する方法
hankehly
0
370
10/29 Airflowの基礎を学ぶハンズオンワークショップ
hankehly
0
340
システム/データ品質保証のための Airflow 活用法
hankehly
0
700
Other Decks in Technology
See All in Technology
LLM Content Moderationを支える評価・改善ループの実践
suikabar
0
120
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
310
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.2k
価値について
gree_tech
PRO
0
110
Rust で関数型ドメインモデリング
takonda
0
170
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
210
トークン化預金DCJPYの取り組みと活用ユースケース
finengine
0
190
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
120
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
2
320
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
300
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
500
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
160
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Leo the Paperboy
mayatellez
10
2.4k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Fireside Chat
paigeccino
43
4.1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
Transcript
OpenTelemetryで分散型アプリケーション の処理フローを可視化する
• Hank Ehly (ハンク イーリー) • ENECHANGE株式会社 • qiita.com/hankehly •
github.com/hankehly • connpass.com/user/hankehly • New: Meety (カジュアル面談) 自己紹介
アジェンダ 1. オブザーバビリティとは 2. OpenTelemetryとは 3. トレースとは 4. Pythonアプリケーションの導入例
• 内部構造を知らなくても、外側から動き方が理解できる • 出会ったことがない問題でも、原因特定が容易にできる オブザーバビリティとは アプリケーションは、シグナルを出す必要がある 1. トレース 2. メトリクス
3. ログ これをインストルメンテーション と言います。 WHY IS THIS HAPPENING? エラー I see..
オブザーバビリティとは • 分散型アプリケーション(Lambda、Kubernetes、ECS、RDS…) • より速く、独立した形でアプリケーションを構築/リリース • 規模が大きくなると、処理の流れやサービスの関係の確認が難しくなる • デプロイ後のトラブル・緊急時に、スピードと情報の正確性が非常に重要 PostgreSQL
:5432 Ruby on Rails :3000 Nginx :8000 Airflow :8080 /mnt/data (ストレージ) 1インスタンスに全部 PostgreSQL Airflow Ruby on Rails /Nginx ストレージ 独立している
OpenTelemetryとは • アプリケーションコードをインスツルメンテーションする仕組みです。 • ベンダーに依存しない、標準化されたツールを提供する ◦ SDK(Python、Ruby、JavaScript、Go、Java、等々…) ◦ API(ルール定義) ◦
テレメトリーデータを受信、処理、出力するための「 Collector」バイナリー
OpenTelemetryとは ECS Cluster Lambda 1 分散型アプリケーション Lambda 2 DynamoDB
OpenTelemetryとは Collector ECS Cluster Lambda 1 分散型アプリケーション Lambda 2 収集/転送
DynamoDB
X-Ray OpenTelemetryとは Collector Datadog Prometheus Jaeger ECS Cluster Lambda 1
分散型アプリケーション Lambda 2 可視化/保存 収集/転送 DynamoDB
フォーム送信(ブラウザー) 時間 トレースとは POST /api/tasks GET /firebase/auth Task.objects.create (Python) INSERT
INTO tasks … (SQL) • 何が、どの順番で行われ、どのくらい時間かかったかが分かる • ボタン押下、HTTPリクエスト、Python関数実行、DBからレコード取得…
{ "name": "Example Trace", "context": { "trace_id": "0x5b8aa5a2d2c872e8321cf37308d69df2", "span_id": "0x5fb397be34d26b51",
}, "start_time": "2022-04-29T18:52:58.114304Z", "end_time": "2022-04-29T18:52:58.114435Z", "events": [ { "name": "フォーム送信(ブラウザー)", "timestamp": "2022-04-29T18:52:58.114561Z" }, { "name": "POST /api/tasks", "timestamp": "2022-04-29T18:53:00.012345Z" }, { "name": "GET /firebase/auth", "timestamp": "2022-04-29T18:53:01.012345Z" } ... 処理フロー
ウェブリクエスト 非同期的ジョブ実行 S3バケット一覧取得
実装は大変そう…
Auto Instrumentation (自動インストルメンテーション)
import os import sys def main(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "instrumentation_example.settings") try: from
django.core.management import execute_from_command_line except ImportError as exc: ...
import os import sys +from opentelemetry.instrumentation.django import DjangoInstrumentor def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "instrumentation_example.settings") + DjangoInstrumentor().instrument() try: from django.core.management import execute_from_command_line except ImportError as exc: ... 自動インストルメンテーション (モンキーパッチ)
import os import sys +from opentelemetry.instrumentation.django import DjangoInstrumentor +from opentelemetry.instrumentation.botocore
import BotocoreInstrumentor def main(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "instrumentation_example.settings") + DjangoInstrumentor().instrument() + BotocoreInstrumentor().instrument() try: from django.core.management import execute_from_command_line except ImportError as exc: ...
import os import sys +from opentelemetry.instrumentation.django import DjangoInstrumentor +from opentelemetry.instrumentation.botocore
import BotocoreInstrumentor +from opentelemetry.instrumentation.redis import RedisInstrumentor def main(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "instrumentation_example.settings") + DjangoInstrumentor().instrument() + BotocoreInstrumentor().instrument() + RedisInstrumentor().instrument() try: from django.core.management import execute_from_command_line except ImportError as exc: ...
コンテキストのプロパゲーション trace_id=123 trace_id=123 trace_id=123 trace_id=123
ご清聴ありがとうございます! Jaeger OpenTelemetry X-Ray ADOT AWS Cloud Trace GCP OSS