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 + LLM = OpenLLMetry!?
Search
Yunosuke Yamada
May 14, 2025
Programming
1.2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
OpenTelemetry + LLM = OpenLLMetry!?
Yunosuke Yamada
May 14, 2025
More Decks by Yunosuke Yamada
See All by Yunosuke Yamada
AI時代に成長するエンジニアに必要なスキルとは.pdf
yunosukey
0
250
Gemini CLIでもセキュアで堅牢な開発をしたい!
yunosukey
1
660
DevOps/MLOpsに学ぶエージェントの可観測性
yunosukey
1
1.2k
Agent Development Kitで作るマルチエージェントアプリケーション(AIAgent勉強会)
yunosukey
4
1.9k
Agent Development Kitで作るマルチエージェントアプリケーション(GCNT2025)
yunosukey
0
90
AIエージェントのオブザーバビリティについて
yunosukey
1
940
クラウド開発環境Cloud Workstationsの紹介
yunosukey
0
470
フロントエンドオブザーバビリティ on Google Cloud
yunosukey
1
390
ChatGPTのアルゴリズム
yunosukey
0
460
Other Decks in Programming
See All in Programming
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
670
ソフトウェアラスタライザ
fadis
1
790
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
140
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
140
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
0
240
スマート反転とウェブアクセシビリティ
camiha
0
130
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
260
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
140
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.9k
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
270
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
The Cost Of JavaScript in 2023
addyosmani
55
10k
The Curse of the Amulet
leimatthew05
2
14k
Code Review Best Practice
trishagee
74
20k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Producing Creativity
orderedlist
PRO
348
41k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Into the Great Unknown - MozCon
thekraken
41
2.7k
エンジニアに許された特別な時間の終わり
watany
108
250k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
WENDY [Excerpt]
tessaabrams
12
39k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
270
Transcript
OpenTelemetry + LLM = OpenLLMetry!? Jagu'e'r オブザービリティ分科会 Meetup#2 株式会社スリーシェイク 山田悠之介
Copyright © 3-shake, Inc. All Rights Reserved.
宣伝 弊社有志による技術勉強会 『3-shake SRE Tech Talk #12 オンサイト』が あさって(5/16)開催されます! 今回のテーマはオブザーバビリティとなっております。
オンライン、オフラインともに余裕があるので お時間ある方はぜひ! 2
生成AIアプリとオブザーバビリティ ここ1、2年でRAGやAIエージェントなど生成AIを利用したアプリケーションが増加 生成AIアプリの難しさに対してオブザーバビリティを考える必要性 3 何が生成 される? どれくらい 時間がかかる? どれくらい お金がかかる?
巨大な ワークフロー 外部サービス の呼び出し モデルの更新
OpenLLMetry、OpenLIT いくつか解決策の方針があります 解決策 4 監視SaaSの機能を利用する OpenTelemetryを利用する 専用のツールを利用する DatadogのLLM Observability、 New
RelicのAI monitoring、 SentryのLLM Monitoringなど LangSmith、Langfuse
OpenLLMetryとは LLM向けにOpenTelemetryを拡張したOSS 特徴 • 監視ツールに依存しない計装 • 独自のテレメトリも収集可能 • Python、Node.js、Go、Rubyに対応 こんな場合にオススメ
• 既存の監視でOpenTelemetryを使っている • LLM Monitoring機能のあるSaaS、ツールを使っていない 万人向けではない • 監視ツールは「作るのではなく買う」『入門 監視』 5 https://docs.kloudmate.com/openllmetry-opentelemetry-based-observability-for-llms
どのような値が取れるか • OpenTelemetry側にSemantic conventions for generative AI systems というのがあり、概ねそれに準拠している ◦
というかOpenLLMetryのセマンティック規約が OpenTelemetryに取り込まれたらしい • 一部を抜粋すると ◦ ベンダー、モデル ◦ 生成の設定(max_tokens、temperature、top_p) ◦ リクエストとレスポンス、トークン数 6
インテグレーション 主な計装対象(一部抜粋) • Anthropic • Amazon Bedrock • OpenAI、Azure OpenAI
• LangChain • Gemini AI、Vertex AI 主な送信先(一部抜粋) • OpenTelemetry Collector、Grafana • Datadog、Dynatrace、New Relic、Sentry、Splunk • Google Cloud、Azure 7
やってみる Pythonでの自動計装 8 from opentelemetry.exporter.cloud_logging import CloudLoggingExporter from opentelemetry.exporter.cloud_trace import
CloudTraceSpanExporter from opentelemetry.exporter.cloud_monitoring import CloudMonitoringMetricsExporter from traceloop.sdk import Traceloop Traceloop.init( app_name="your-app-name", exporter=CloudTraceSpanExporter(), metrics_exporter=CloudMonitoringMetricsExporter(), logging_exporter=CloudLoggingExporter(), )
やってみる Vertex AI SDKを使った呼び出し 9 import vertexai from vertexai.generative_models import
GenerativeModel vertexai.init( project=PROJECT_ID, location=LOCATION, ) model = GenerativeModel("gemini-2.5-flash-preview-04-17") response = model.generate_content("OpenTelemetryって何?")
やってみる Traceエクスプローラで確認 10
自動計装の実装を見てみる(1) 自動計装対象のメソッドの一覧 11 WRAPPED_METHODS = [ { "package": "vertexai.generative_models", "object":
"GenerativeModel", "method": "generate_content", "span_name": "vertexai.generate_content", "is_async": False, }, ... https://github.com/traceloop/openllmetry/blob/7a1b8bbea7fcffb2f7cbd127fada7b6c7b046280/packages/ opentelemetry-instrumentation-vertexai/opentelemetry/instrumentation/vertexai/__init__.py#L29-L36
自動計装の実装を見てみる(2) wraptによるラッピング 12 for wrapped_method in WRAPPED_METHODS: wrap_package = wrapped_method.get("package")
wrap_object = wrapped_method.get("object") wrap_method = wrapped_method.get("method") wrap_function_wrapper( wrap_package, f"{wrap_object}.{wrap_method}", ( _awrap(tracer, wrapped_method) if wrapped_method.get("is_async") else _wrap(tracer, wrapped_method) ), ) https://github.com/traceloop/openllmetry/blob/7a1b8bbea7fcffb2f7cbd127fada7b6c7b046280/packages /opentelemetry-instrumentation-vertexai/opentelemetry/instrumentation/vertexai/__init__.py#L360-L3
自動計装の実装を見てみる(3) ラッパーの処理 13 span = tracer.start_span( name, kind=SpanKind.CLIENT, attributes={ SpanAttributes.LLM_SYSTEM:
"VertexAI", SpanAttributes.LLM_REQUEST_TYPE: LLMRequestTypeValues.COMPLETION.value, }, ) _handle_request(span, args, kwargs, llm_model) response = wrapped(*args, **kwargs) if response: if is_streaming_response(response): return _build_from_streaming_response(span, response, llm_model) elif is_async_streaming_response(response): return _abuild_from_streaming_response(span, response, llm_model) else: _handle_response(span, response, llm_model) span.end() return response https://github.com/traceloop/openllmetry/blob/7a1b8bbea7fcffb2f7cbd127fada7b6c7b046280/pack ages/opentelemetry-instrumentation-vertexai/opentelemetry/instrumentation/vertexai/__init__.py# L322-L344 入力の情報をスパン属性に追加 出力の情報をスパン属性に追加、など
注意点 • Google Gen AI SDKは未対応 ◦ Gen AI SDK:Gemini
APIとVertex AIを統一的に扱えるライブラリ ◦ https://github.com/traceloop/openllmetry/issues/2675 • OpenTelemetryのセマンティック規約に完全に準拠しているわけではない ◦ 例えばプロンプトのイベント ▪ https://github.com/traceloop/openllmetry/issues/2456 ◦ とはいえOpenTelemetryの生成AIのセマンティック規約自体がDevelopmentではある 14
まとめ • 生成AIアプリケーションもオブザーバビリティが必要 • 解決策の1つとしてOpenLLMetryによるOTel計装があり、 自動計装することができる • Gen AI SDKの対応やOpenTelemetryのセマンティック規約への準拠など
発展途上な部分もある 15