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
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
フィンテック養成勉強会#68
finengine
0
160
Refining Active Record
shugo
0
170
夫婦で子育てするための育児標準化
codmoninc
PRO
0
480
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
2
320
Local CI × GitHub Actions
gogutan
3
230
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
140
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
140
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.2k
スプシの手作業からの解脱 ~更新はClaude Codeに、見せ方と使い方はGASアプリに任せる~
kentarofujii
0
160
What Is JetBrains Air
x5gtrn
PRO
0
110
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
200
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
210
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
4
540
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
760
How to train your dragon (web standard)
notwaldorf
96
6.9k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Large-scale JavaScript Application Architecture
addyosmani
516
110k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
610
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Accessibility Awareness
sabderemane
1
250
The Mindset for Success: Future Career Progression
greggifford
PRO
0
540
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