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.1k
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
190
Gemini CLIでもセキュアで堅牢な開発をしたい!
yunosukey
1
610
DevOps/MLOpsに学ぶエージェントの可観測性
yunosukey
1
1.1k
Agent Development Kitで作るマルチエージェントアプリケーション(AIAgent勉強会)
yunosukey
4
1.7k
Agent Development Kitで作るマルチエージェントアプリケーション(GCNT2025)
yunosukey
0
75
AIエージェントのオブザーバビリティについて
yunosukey
1
900
クラウド開発環境Cloud Workstationsの紹介
yunosukey
0
460
フロントエンドオブザーバビリティ on Google Cloud
yunosukey
1
360
ChatGPTのアルゴリズム
yunosukey
0
440
Other Decks in Programming
See All in Programming
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.5k
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
120
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
140
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
390
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
120
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
230
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
250
Vite+ Unified Toolchain for the Web
naokihaba
0
290
The NotImplementedError Problem in Ruby
koic
1
740
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
5.6k
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
The SEO Collaboration Effect
kristinabergwall1
1
480
Facilitating Awesome Meetings
lara
57
7k
Google's AI Overviews - The New Search
badams
0
1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
Unsuck your backbone
ammeep
672
58k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
360
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Leo the Paperboy
mayatellez
7
1.8k
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