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で分散型アプリケーション の処理フローを可視化する
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Hank Ehly
September 05, 2022
Technology
1.7k
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
660
Celeryの紹介と本番運用のTips
hankehly
0
1.7k
ChatGPTを活用した 便利ツールの紹介
hankehly
1
1.4k
Efficient Energy Analytics with Airflow, Spark, and MLFlow
hankehly
0
410
Deferrable Operators入門
hankehly
0
770
【初心者/ハンズオン】Dockerコンテナの基礎知識
hankehly
0
610
Compositeパターン: オブジェクトの階層関係をエレガントに表現する方法
hankehly
0
360
10/29 Airflowの基礎を学ぶハンズオンワークショップ
hankehly
0
320
システム/データ品質保証のための Airflow 活用法
hankehly
0
690
Other Decks in Technology
See All in Technology
Goでデータパイプラインを作ろう
sansantech
PRO
0
350
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
11
8.4k
【Google Cloud Next Tokyo'26】Gemini Enterprise と Oracle AI Database で実現する、業務データ活用を実現する AI エージェント実装
shisyu_gaku
0
230
第3回しろおびセキュリティスポンサーセッション
log0417
0
160
20260801_スクフェス大阪
kgnkhkr
2
1.2k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
Data Hubグループ 紹介資料
sansan33
PRO
0
3.1k
Service Connect 上のサービスに ECS Service の外側から到達できなかった話
ota1022
1
150
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
え?フロントエンドエンジニアの ワイがインフラも!?
puku0x
1
430
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
19k
Featured
See All Featured
AI: The stuff that nobody shows you
jnunemaker
PRO
9
890
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
390
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Typedesign – Prime Four
hannesfritz
42
3.1k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
The SEO identity crisis: Don't let AI make you average
varn
0
530
Technical Leadership for Architectural Decision Making
baasie
3
470
Un-Boring Meetings
codingconduct
0
380
Darren the Foodie - Storyboard
khoart
PRO
3
3.5k
Odyssey Design
rkendrick25
PRO
2
750
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